Dimitri Liakhovitski
2013-Oct-01 14:41 UTC
[R] glm's for a logistic regression - no warnings?
I have this weird data set with 2 predictors and one dependent variable - attached. predictor1 has all zeros except for one 1. I am runnning a simple logistic regression: temp<-read.csv("x data for reg224.csv") myreg <- glm(dv~predictor1+predictor2,data=temp, family=binomial("logit")) myreg$coef2 Everything runs fine and I get the coefficients - and the fact that there is only one 1 on one of the predictors doesn't seem to cause any problems. However, when I run the same regression in SAS, I get warnings: Model Convergence Status Quasi-complete separation of data points detected. Warning: The maximum likelihood estimate may not exist. Warning: The LOGISTIC procedure continues in spite of the above warning. Results shown are based on the last maximum likelihood iteration. Validity of the model fit is questionable. And the coefficients SAS produces are quite different from mine. I know I'll probably get screamed at because it's not a pure R question - but any idea why R is not giving me any warnings in such a situation? Does it have no problems with ML estimation in this case? Thanks a lot! -- Dimitri Liakhovitski
google "complete separation logistic" -- Bert On Tue, Oct 1, 2013 at 7:41 AM, Dimitri Liakhovitski <dimitri.liakhovitski at gmail.com> wrote:> I have this weird data set with 2 predictors and one dependent variable - > attached. > > predictor1 has all zeros except for one 1. > I am runnning a simple logistic regression: > > temp<-read.csv("x data for reg224.csv") > myreg <- glm(dv~predictor1+predictor2,data=temp, > family=binomial("logit")) > myreg$coef2 > > Everything runs fine and I get the coefficients - and the fact that there > is only one 1 on one of the predictors doesn't seem to cause any problems. > > However, when I run the same regression in SAS, I get warnings: > Model Convergence Status Quasi-complete separation of data points > detected. > > Warning: The maximum likelihood estimate may not exist. > Warning: The LOGISTIC procedure continues in spite of the above warning. > Results shown are based on the last maximum likelihood iteration. Validity > of the model fit is questionable. > > And the coefficients SAS produces are quite different from mine. > > I know I'll probably get screamed at because it's not a pure R question - > but any idea why R is not giving me any warnings in such a situation? > Does it have no problems with ML estimation in this case? > > Thanks a lot! > > > -- > Dimitri Liakhovitski > > ______________________________________________ > R-help at r-project.org mailing list > 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. >-- Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374
Hi, I did have warning messages about convergence issues using binomial GLM with logit link with my data in the past.... Do you detect separation using the function separation.detection{brglm}? Regards, Xochitl C. <>< <>< <>< <>< Xochitl CORMON +33 (0)3 21 99 56 84 Doctorante en sciences halieutiques PhD student in fishery sciences <>< <>< <>< <>< IFREMER Centre Manche Mer du Nord 150 quai Gambetta 62200 Boulogne-sur-Mer <>< <>< <>< <>< Le 01/10/2013 16:41, Dimitri Liakhovitski a ?crit :> I have this weird data set with 2 predictors and one dependent variable - > attached. > > predictor1 has all zeros except for one 1. > I am runnning a simple logistic regression: > > temp<-read.csv("x data for reg224.csv") > myreg<- glm(dv~predictor1+predictor2,data=temp, > family=binomial("logit")) > myreg$coef2 > > Everything runs fine and I get the coefficients - and the fact that there > is only one 1 on one of the predictors doesn't seem to cause any problems. > > However, when I run the same regression in SAS, I get warnings: > Model Convergence Status Quasi-complete separation of data points > detected. > > Warning: The maximum likelihood estimate may not exist. > Warning: The LOGISTIC procedure continues in spite of the above warning. > Results shown are based on the last maximum likelihood iteration. Validity > of the model fit is questionable. > > And the coefficients SAS produces are quite different from mine. > > I know I'll probably get screamed at because it's not a pure R question - > but any idea why R is not giving me any warnings in such a situation? > Does it have no problems with ML estimation in this case? > > Thanks a lot! > > > > > > ______________________________________________ > R-help at r-project.org mailing list > 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.