I am trying to see the level of relationship between a variable with two categories and an ordered variable.
We can assume this variable with 3 levels.
0 -> does not contrac
1 -> contract 6 months
2 -> contract 1 year
To see the level of association between two categorical variables, I have to perform the Chi-square test as long as no more than 20% of the expected frequencies is less than 5.
My question is whether when performing the Chi-square test, I have to convert the ordered variable into an ordered factor or not.
I ask myself the same question when making the logistic regression model. Since the results are different when ordering it.
Just a quick answer. I don't have a background in stats, but a few months ago I had to use lm() for categoricals, so I looked it up in a textbook.
My understanding from regression (lm/glm) on categorical vars is that the outcome coefficients are relative to a reference baseline. The reference is the first factor level of the vars. This is the intercept. So releveling the factors creates a new reference, hence new statistics.
I hope this explains. If not , I hope someone with deeper understanding jumps in.