I am quite puzzled by the logistic regression results with three outcome categories
0 is no feelings, 1 is slightly happy, 2 is extremely happy.
I tried both (1) logistic regression and ordered the outcome (2) using ordinal logistic regression through
The summary from
(1) looks like this:
Call: glm(formula = FeelingOutcome ~ Dosage + Age + factor(Sex.x) + factor(Race.x) + TestPeriod, family = binomial, data = TestSet, na.action = "na.exclude") Deviance Residuals: Min 1Q Median 3Q Max -1.7767 -1.1058 0.6135 1.0088 2.0481 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.457e+01 1.455e+03 0.010 0.9920 Dosage -1.981e+00 8.145e-01 -2.433 0.0150 * Age 4.434e-02 2.494e-02 1.778 0.0755 . factor(Sex.x)Male 6.504e-01 4.544e-01 1.431 0.1523 factor(Race.x)Black -1.670e+01 1.455e+03 -0.011 0.9908 factor(Race.x)White -1.513e+01 1.455e+03 -0.010 0.9917 TestPeriod -1.413e-04 1.319e-04 -1.072 0.2839 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 146.34 on 105 degrees of freedom Residual deviance: 130.71 on 99 degrees of freedom (2 observations deleted due to missingness) AIC: 144.71 Number of Fisher Scoring iterations: 14
The statistics showed moderate significance of Dosage association with Feeling Outcome.
However, when I use ordinal logistic regression, the strange number showed:
TestORdinalLR <- MASS::polr(FeelingOutcome ~ Dosage + Age + factor(Sex.x) + factor(Race.x) + TestPeriod, data=TestSet, Hess = TRUE, na.action = "na.exclude") ctable <- coef(summary(TestORdinalLR)) p_OrdiDxSHCec <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2 ctable <- cbind(ctable, "p value" = p_OrdiDxSHCec) > ctable Value Std. Error t value p value Dosage -1.270935e+00 0.0948121344 -13.4047742 5.669557e-41 Age 3.844785e-02 0.0138925651 2.7675126 5.648587e-03 factor(Sex.x)Male 1.799269e-01 0.3784498549 0.4754313 6.344796e-01 factor(Race.x)Black -1.670944e+01 0.3947162775 -42.3327766 0.000000e+00 factor(Race.x)White -1.536035e+01 0.4342894383 -35.3689268 5.131513e-274 TestPeriod -4.578557e-05 0.0003773869 -0.1213226 9.034355e-01 0|1 -1.432219e+01 0.0395987756 -361.6826279 0.000000e+00 1|2 -1.365826e+01 0.1579986481 -86.4454177 0.000000e+00
I saw a whopping p-value change from
5.669557e-41. Intuitively, I know I should use ordinal logistic regression, but from the results, the logistic regression seems more realistic?
Here's the data distribution (I flipped the x and y for visualization):
family=binomialwill fit a logistic regression with two outcome levels only, not three outcome levels. $\endgroup$
factor(Race.x)? You show coefficients for both
White, so the reference level presumably has relatively few members in your data. You didn't get an error in binomial logistic regression because, as the help page says, "the response can also be specified as a factor (when the first level denotes failure and all others success)." Your outcome was presumably interpreted as a factor. $\endgroup$
glm(family=binomal)will use the first level as the first level, and all other levels as the second level. $\endgroup$
glmshould only have two outcomes. Anything more than three should be multivariable or ordinal, and I will study a bit to see if I need more help. Thank you all for your time. $\endgroup$