Something changed and glm(..., family=binomial) doesn't work now

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Something changed and glm(..., family=binomial) doesn't work now

Philip Riggs
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Something changed and glm(..., family=binomial) doesn't work now

Peter Dalgaard
Philip Riggs <[hidden email]> 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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Something changed and glm(..., family=binomial) doesn't work now

White, Charles E WRAIR-Wash DC
In reply to this post by Philip Riggs
"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/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html