[R-sig-ME] Lmer binomial distribution x HLM Bernoulli distribution

Douglas Bates bates at stat.wisc.edu
Tue Feb 1 20:49:56 CET 2011


On Tue, Feb 1, 2011 at 1:23 PM, Luana Marotta <lucsmarotta at gmail.com> wrote:
> Dear R-users,
> I'm running a lmer model using the lme4 package. My dependent variable is
> dichotomous and I'm using the "binomial" family. The results
> are slightly different from the HLM results based on a Bernoulli
> distribution. Please, see the results below:
>
> Level 1 info:  Size: 129006      Mean: 0.7082 (dichotomous variable 0/1)
>
> Level2 info:   Size:  384
>
>
>
> HLM model:
>
> Distribution at Level-1: Bernoulli
>
> Level-1 Model
>
>                 Prob(Y=1|B) = P
>
>                 log[P/(1-P)] = B0
>
>
>
> Level-2 Model
>
>                 B0 = G00 + U0
>
> HLM results:
>
> Random effects:
>
> Groups Name          Variance Std.Dev.
>
> schid  (Intercept)     0.17727  0.42104
>
>
>
> Fixed effects:
>
>                           Estimate Std. Error    z value Pr(>|z|)
>
> (Intercept)          1.001561     0.023039  43.473   0.000
>

> R model:
>
> lmer(measurebi_general ~ 1 + (1 | schid), data=data_valid_general,
> family=binomial)
>
>
>
> R results:
>
>    AIC    BIC logLik deviance
>
>  153195 153214 -76595   153191
>
>
>
> Random effects:
>
> Groups Name          Variance Std.Dev.
>
> schid  (Intercept)     0.18007  0.42434
>
>
>
> Fixed effects:
>
>                           Estimate Std. Error z value Pr(>|z|)
>
> (Intercept)          1.0071     0.0232   43.41   <2e-16 ***
>
> Is there anyway that I can adapt my R model so that the R results are the
> same as the HLM results?
>
> I'm using the lme4 for linear data and the R results are exactly the same as
> the ones produced by HLM. It is very important for me to have both results
> the same because I'll be discussing the results with researchers who use
> exclusively the HLM software.

I am essentially repeating Harold Doran's comments but I started
writing this before I saw his message.

Well those answers are pretty close to each other.  Fitting a GLMM is
not a straightforward process, even compared to fitting a linear mixed
model.  First you must decide how you are going to evaluate the
deviance of a model then try to optimize it and different optimizers
may produce slightly different results.




More information about the R-sig-mixed-models mailing list