When using the glm
function in the stats
package with ordinal variables
data$X1 <- ordered(data$X1)
data$X2 <- ordered(data$X2)
data$X3 <- ordered(data$X3)
data$X4 <- ordered(data$X4)
data$X5 <- ordered(data$X5)
data$X6 <- ordered(data$X6)
glm(Y ~ X1 + X2 + X3 + X4 + X5 + X6, data = data)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.19445 0.07169 30.610 < 2e-16 ***
X1.L 0.48235 0.10060 4.795 2.48e-06 ***
X1.Q -0.42570 0.08366 -5.089 6.11e-07 ***
X1.C -0.01543 0.07109 -0.217 0.82832
X1^4 -0.06392 0.05936 -1.077 0.28230
X2.L 0.51696 0.26341 1.963 0.05055 .
X2.Q -0.34153 0.19369 -1.763 0.07879 .
X2.C 0.28979 0.13800 2.100 0.03651 *
X2^4 -0.30389 0.10082 -3.014 0.00278 **
X3.L -0.01790 0.10756 -0.166 0.86790
X3.Q 0.17086 0.08730 1.957 0.05119 .
X3.C 0.04131 0.07452 0.554 0.57975
X3^4 0.08683 0.06149 1.412 0.15891
X4.L 0.18349 0.27466 0.668 0.50457
X4.Q 0.32422 0.20563 1.577 0.11583
X4.C -0.39733 0.14880 -2.670 0.00796 **
X4^4 0.29617 0.10123 2.926 0.00368 **
X5.L 0.29977 0.10860 2.760 0.00610 **
X5.Q -0.35389 0.08825 -4.010 7.53e-05 ***
X5.C 0.03904 0.07258 0.538 0.59102
X5^4 -0.02931 0.05908 -0.496 0.62011
X6.L 0.16479 0.18020 0.915 0.36113
X6.Q -0.14659 0.15071 -0.973 0.33146
X6.C 0.05724 0.11289 0.507 0.61245
X6^4 -0.09772 0.07570 -1.291 0.19764
---
...
I understand the variables with .L
, .Q
, and .C
and ^4
are, respectively, the coefficients for the ordered factor coded with linear, quadratic, cubic, and quartic contrasts.
Some of the variables are significant (***
, **
, *
) but they're nonlinear (for example: X2
). My question is, when reporting the result of which variable is statically significant in predicting Y, and whether these variable have positive weights or not, which coefficient should you use?
These predictors (X1
,X2
,X4
, X5
) have significant coefficients in their linear, quadratic, cubic etc. forms, but in opposite directions.
Is it valid to say that X2
is statically significant in predicting Y
and has a positive correlation?
Can someone point me to something that would help me understand how to report the results of glm
analyses using ordered factors?