[R-sig-ME] Do glmer and glmmadmb calculate log likelihood on thesame scale ?

Joshua Wiley jwiley.psych at gmail.com
Fri Jun 22 09:45:23 CEST 2012


Curious.  I so boldly stuck my foot in my mouth about using corStruct
= "full" to equate to glmer(), yet the log likelihood remains
unchanged using it or not in another case I ran where I could get the
model to converge.  Interestingly, a correlation is printed when
corStruct = "full", but somehow the log likelihood and model df do not
change?  I am adding Ben Bolker to this (although he probably would
have seen it soon enough anyway).  A) because it may be relevant that
your original model converges in an older version of glmmadmb, but not
the one I am using. B) because I do not understand why the correlation
among random effects does not seem to affect the log likelihood and
model df in glmmadmb but does in glmer.

glmmadmb(formula = y ~ Visit + (Visit | subject), data = epil2,
    family = "poisson", corStruct = "full")
gives:

Number of observations: total=236, subject=59
Random effect variance(s):
Group=subject
            Variance StdDev Corr
(Intercept) 0.8881   0.9424 (Intr)
Visit       0.5399   0.7348 0.5399

Log-likelihood: -686.899

glmer(y ~ Visit + (Visit|subject), data = epil2, family = "poisson")

gives:

   AIC   BIC logLik deviance
 617.9 635.2 -303.9    607.9
Random effects:
 Groups  Name        Variance Std.Dev. Corr
 subject (Intercept) 0.88772  0.94219
         Visit       0.53592  0.73206  -0.034
Number of obs: 236, groups: subject, 59


On Thu, Jun 21, 2012 at 7:13 PM, David Duffy <David.Duffy at qimr.edu.au> wrote:
> On Thu, 21 Jun 2012, Joshua Wiley wrote:
>
>> Just a note that those are not the same models.
>
>
> Huh.
>
>
>> OR you could change glmmadmb() to
>>
>> fm2 <- glmmadmb(y~Base*trt+Age+Visit+(Visit|subject),
>>  data=epil2, family="poisson", corStruct = "full")
>
>
>> however, on my machine, there are warnings about the matrix not being
>> positive definite, and the model never converges.
>
>
> I haven't updated glmmADMB recently (0.6.4 2011-08-30), so it
> gives the warning, but continues merrily to give:
>
>            (Intercept)   Visit
> (Intercept)     0.24931 0.24931
> Visit           0.54572 0.54572
>
> and the same likelihood as before
>
> Log-likelihood: -655.41
>
> glmer was
>  Groups  Name        Variance Std.Dev. Corr
>  subject (Intercept) 0.24912  0.49912
>         Visit       0.53962  0.73459  0.011
>  'log Lik.' -262.6586 (df=9)
>
> Your suggestion Visit + (1 | Visit) + (0 + Visit | subject) gave me
>
>  Groups  Name        Variance   Std.Dev.
>  subject Visit       0.77301    0.87921
>  Visit   (Intercept) 5.1845e-16 2.2769e-08
> 'log Lik.' -421.1128 (df=8)
>
> I have to admit, the direction of the change in loglikelihood here confuses
> me a little ;)
>
> My lme4 is also a little antiquated: 0.999375-42 (2011-10-02).
>
>
> --
> | David Duffy (MBBS PhD)                                         ,-_|\
> | email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
> | Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
> | 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/



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