# Abusing statistics- assessing the power of classification connection by flipping X and Y in a linear model

I am supposed to check the significance of the connection between an arbitary Y variable (nominal\ordinal\binary I cannot know in advance) and an arbitary numeric X variable.

This is a classification problem. However may I just flip the Y and X variables to make the problem simpler and use ANOVA? Instead of Y~X, just X~Y?

in the following post I see the slope of the line changes if we swap Y~X to X~Y. I wonder if it also applies to ANOVA. or effect the goodness of fit: Effect of switching response and explanatory variable in simple linear regression

when I do a little test (am variable is binary):

mydata <- mtcars

summary(lm(am~mpg,data = mydata))

summary(lm(mpg~am,data = mydata))


the F statistic for both regressions is the same.

Thanks!

• Hi and welcome to CV! The two approaches serve different purposes and need different assumptions. Commented Sep 12, 2023 at 8:02
• sure does! but I only wish to assesss the strengh of the connenction, nothing more. Commented Sep 12, 2023 at 8:53
• Welcome to Cross Validated! Why don’t you know the type of $y$ variable you will be getting? // It has been argued that it is advantageous to model the categorical outcome.
– Dave
Commented Sep 12, 2023 at 10:30
• @Dave, actually I can get the following information on the y variable- number of categories (binary, multiclass). I do not know the order (even if defined it might be defined out of ggplot needs and not relate to actual ordinal levels). My issue is mostly with the multiclass situation Commented Sep 12, 2023 at 10:57

The correlation between $$X$$ and $$Y$$ is the same as the correlation between $$Y$$ and $$X$$, and this extends to some other summaries. As you note, the usual test statistic is the same. The slopes are the same if the variables are scaled to have the same variances (eg, if they are scaled to have unit variance). Since the slopes are the same, their standard errors are the same.