[R] Why the order of parameters in a logistic regression affects results significantly?
Michael Dewey
lists at dewey.myzen.co.uk
Fri Jul 22 18:21:04 CEST 2016
Dear Peter
Have you tried removing the intercept? Just put -1 at the end of your
formula.
On 21/07/2016 23:04, Qinghua He via R-help wrote:
> Using the same data, if I ran
> fit2 <-glm(formula=AR~Age+LumA+LumB+HER2+Basal+Normal,family=binomial,data=RacComp1)summary(fit2)exp(coef(fit2))
> I obtained:
>> exp(coef(fit2))(Intercept) Age LumA LumB HER2 Basal Normal 0.24866935 1.00433781 0.10639937 0.31614001 0.08220685 20.25180956 NA
> while if I ran
>
> fit2 <-glm(formula=AR~Age+LumA+LumB+Basal+Normal+HER2,family=binomial,data=RacComp1)summary(fit2)exp(coef(fit2))
> I obtained:
>> exp(coef(fit2)) (Intercept) Age LumA LumB Basal Normal HER2 0.02044232 1.00433781 1.29428846 3.84566516 246.35185956 12.16443690 NA
>
> Essentially they're the same model - I just moved HER2 to the last. But the OR changed significantly. Can someone explain?
> For the latter result, I don't even know how to interpret as all factors have OR>1 (except Intercept), how could that possible? Can I eliminate the effect of intercept?
> Also, I cannot obtain OR for the last factor due to collinearity. However, I know others obtained OR for all factors for the same dataset. Can someone tell me how to obtain OR for all factors? All factors are categorical variables (i.e., 0 or 1).
> Thanks!
> Peter
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Michael
http://www.dewey.myzen.co.uk/home.html
More information about the R-help
mailing list