Philip Riggs
2006-Feb-17 23:40 UTC
[R] Something changed and glm(..., family=binomial) doesn't work now
I ran logistic regression models last week using glm (...,family=binomial) and got a set of results. Since then I have loaded the Epi package for ROC analysis. Now when I run those same models I get completely different results, with most being: Warning message: fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, I didn't get this result last week. Also, the ROC function in Epi is no longer working (giving a ROC of 1.000). What would have changed to cause this and how can I fix it? p.s. To check I ran the same model in S and have the same result as last week. Philip
Peter Dalgaard
2006-Feb-18 10:19 UTC
[R] Something changed and glm(..., family=binomial) doesn't work now
Philip Riggs <priggs at warnercnr.colostate.edu> writes:> I ran logistic regression models last week using glm > (...,family=binomial) and got a set of results. Since then I have > loaded the Epi package for ROC analysis. Now when I run those same > models I get completely different results, with most being: > > Warning message: > fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y > = Y, weights = weights, start = start, etastart = etastart, > > I didn't get this result last week. Also, the ROC function in Epi is > no longer working (giving a ROC of 1.000). What would have changed to > cause this and how can I fix it? > > p.s. To check I ran the same model in S and have the same result as > last week.Do you mean "load" or "install" Epi?? If the latter, does it matter whether you use library(Epi) or not? However: This sort of trouble usually means that you are not really fitting the same models to the same data. The warning and the ROC suggests that you have something in your model that gives perfect separation between successes and failures. Are you using data=myframe in the glm call? Otherwise, you're open to masking by variables in your workspace. -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
White, Charles E WRAIR-Wash DC
2006-Feb-18 13:52 UTC
[R] Something changed and glm(..., family=binomial) doesn't work now
"Are you using data=myframe in the glm call? Otherwise, you're open to masking by variables in your workspace." FYI, the data statement doesn't seem to be the shortcut it is elsewhere when the form of the argument is glm(cbind(success,failure)~predictor, family=binomial, data=myframe). The data statement doesn't seem to put 'myframe' in the environment where cbind operates. Choices for the user are to fully quality names inside of cbind [i.e., cbind(myframe$success,myframe$failure)] or to attach 'myframe' to the working environment. The same thing happens in lmer. Chuck Charles E. White, Senior Biostatistician, MS Walter Reed Army Institute of Research 503 Robert Grant Ave., Room 1w102 Silver Spring, MD 20910-1557 301 319-9781 Personal/Professional Site:??http://users.starpower.net/cwhite571/professional/