我使用一组分类变量运行了多项逻辑回归:
自变量:
特征1:是,否,未知。
特征2:是,否,未知。
因变量:
answer:是,否。
> data1$answer <- relevel(data1$answer1, ref="Yes")
> test <- multinom(answer ~ characteristic1 + characteristic3, data = data1)
> summary(test)
Call:
multinom(formula = answer ~ characteristic1 + characteristic2, data = data1)
Coefficients:
Values Std. Err.
(Intercept) 13.2201602 5.250578e+02
characteristic1Unknown -0.5725031 6.159256e+02
characteristic1Yes 5.0148322 2.529555e-14
characteristic2Unknown -11.2613522 3.219936e+02
characteristic2Yes 1.6884884 1.336704e+03
Residual Deviance: 5.004052
AIC: 15.00405
> p
(Intercept) characteristic1Unknown characteristic1Yes characteristic2Unknown
0.9799126 0.9992584 0.0000000 0.9721006
characteristic2Yes
0.9989921
> exp(coef(test));exp(confint(test))
(Intercept) characteristic1Unknown characteristic1Yes characteristic2Unknown
5.513693e+05 5.641116e-01 1.506309e+02 1.286047e-05
characteristic2Yes
5.411295e+00
2.5 % 97.5 %
(Intercept) 0.000000e+00 Inf
characteristic1Unknown 0.000000e+00 Inf
characteristic1Yes 1.506309e+02 1.506309e+02
characteristic2Unknown 1.066145e-279 1.551306e+269
characteristic2Yes 0.000000e+00 Inf
我将其解释为答案变量从特征1:否更改为是时对答案变量具有否与是的对数赔率将增加5.04。
但是,当我运行其他睾丸时,将特征2变量更改为特征3时,特征1具有其他值:
自变量:
特征1:是,否,未知。
特征3:是,否,未知。
因变量:
answer:是,否。
> data1$answer <- relevel(data1$answer1, ref="Yes")
> test <- multinom(answer ~ characteristic1 + characteristic3, data = data1)
> summary(test)
Call:
multinom(formula = answer ~ characteristic1 + characteristic3, data = data1)
Coefficients:
Values Std. Err.
(Intercept) 11.332554 204.3257
characteristic1Unknown -9.540773 204.3286
characteristic1Yes 6.340292 0.0000
characteristic3Unknown 10.680659 361.2806
characteristic3Yes 1.042372 0.0000
Residual Deviance: 5.741692
AIC: 15.74169
> p
(Intercept) characteristic1Unknown characteristic1Yes characteristic3Unknown
0.9557695 0.9627577 0.0000000 0.9764153
characteristic3Yes
0.0000000
> exp(coef(test));exp(confint(test))
(Intercept) characteristic1Unknown characteristic1Yes characteristic3Unknown
8.349599e+04 7.186130e-05 5.669619e+02 4.350622e+04
characteristic3Yes
2.835937e+00
2.5 % 97.5 %
(Intercept) 9.984058e-170 6.982712e+178
characteristic1Unknown 8.544889e-179 6.043433e+169
characteristic1Yes 5.669619e+02 5.669619e+02
characteristic3Unknown 1.306052e-303 Inf
characteristic3Yes 2.835937e+00 2.835937e+00
我的问题是,如果变量答案的对数几率与变量特征1有关,那么当我将变量特征2更改为特征3时,为什么在这两个测试之间会发生变化?
请帮助!