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L, 1L, 1L, 3L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 3L, 3L, 1L, 3L, 1L, 3L,
3L, 1L, 1L, 1L, 3L, 1L, 3L, 3L, 1L, 1L, 1L, 1L, 3L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 3L,
3L, 1L, 1L, 1L, 3L, 3L, 3L), .Label = c("1", "2", "3"), class = "factor")
I have replaced the 1's in x
with 2's in z
and vice versa. Now when I do an ordered logistic regression in R with polr
(library MASS), I get the following coefficients:
f1 <- polr(y~x,Hess=TRUE)
f2 <- polr(y~z,Hess=TRUE)
coef(summary(f1))
Value Std. Error t value
x2 25.95727 0.3028808 85.70127
x3 30.21524 0.5463144 55.30742
1|2 24.02167 0.3480269 69.02246
2|3 27.77068 0.3432316 80.90944
coef(summary(f2))
Value Std. Error t value
z2 -21.495979 6.530398e-10 -3.291680e+10
z3 4.257964 8.119540e-01 5.244095e+00
1|2 -1.935599 3.567345e-01 -5.425880e+00
2|3 1.813399 3.411874e-01 5.314964e+00
It seems that something is not correct. Why relabeling the levels is changing dramatically the estimates for the SEs?