ronggui
2005-Aug-03 10:02 UTC
[R] Multilevel logistic regression using lmer vs glmmPQL vs.gllamm in Stata
>On Wed, 3 Aug 2005, Bernd Weiss wrote: > >> I am trying to replicate some multilevel models with binary outcomes >> using R's "lmer" and "glmmPQL" and Stata's gllmm, respectively. > >That's not going to happen as they are not using the same criteria.the glmmPQL and lmer both use the PQL method to do it ,so can we get the same result by setting some options to the command?>> The data can be found at <http://www.uni-koeln.de/~ahf34/xerop.dta>. >> >> The relevant Stata output can be found at <http://www.uni- >> koeln.de/~ahf34/stataoutput.txt>. First, you will find the >> unconditional model, i.e. no level1- or 2-predictor variables. The >> second model contains some level 1-predictor variables >> >> My R file can be found at <http://www.uni-koeln.de/~ahf34/xerop.R>. >> >> Beside the fact that there is a difference between the estimates of >> the intercept (unconditional model: R: -2.76459 and Stata: -2.698923) >> I am especially interested in the level 2 variance. >> >> In Stata the level 2 variance is about 1.03, while in R it is 4.68. >> >> Using glmmPQL from package MASS again gives different results for the >> level 2 variance component. What is meant by "Residual"? I thought >> the level 1 variance is fixed to (pi^2)/3. > >Please read the book for which this is support software, as it definitely >does not say that, and it does explain how such differences can occur. > >-- >Brian D. Ripley, ripley at stats.ox.ac.uk >Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ >University of Oxford, Tel: +44 1865 272861 (self) >1 South Parks Road, +44 1865 272866 (PA) >Oxford OX1 3TG, UK Fax: +44 1865 272595 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html= = = = = = = = = = = = = = = = = = = 2005-08-03 ------ Deparment of Sociology Fudan University Blog:http://sociology.yculblog.com
Bernd Weiss
2005-Aug-04 06:11 UTC
[R] Multilevel logistic regression using lmer vs glmmPQL vs.gllamm in Stata
Am 3 Aug 2005 um 18:02 hat ronggui geschrieben:> >On Wed, 3 Aug 2005, Bernd Weiss wrote: > > > >> I am trying to replicate some multilevel models with binary > >> outcomes using R's "lmer" and "glmmPQL" and Stata's gllmm, > >> respectively.[...]> the glmmPQL and lmer both use the PQL method to do it ,so can we get > the same result by setting some options to the command? >Thanks to Prof. Ripley and ronggui for their answers. To verify my findings I tried other datasets and simulated some data and compared the results between R and Stata. Everything works fine, no differences -- except for the xerop-dataset. Having a closer look to the R output I found some unusual values for AIC, BIC and deviance, see below: AIC BIC logLik deviance 1.797693e+308 1.797693e+308 -8.988466e+307 1.797693e+308 I assume I have to change some of the lmer-parameters but have absolutely no idea which one. Again, I would appreciate any help. Bernd