[R-sig-ME] Providing starting values for glmer()

Ravi Varadhan ravi.varadhan at jhu.edu
Wed Jul 23 21:29:13 CEST 2014


I am getting sensible results for the same model from SAS: both PROC GLIMMIX and NLMIXED were able to provide "reasonable looking" estimates.  I can send you the results, if you are interested.

Ravi

-----Original Message-----
From: Ben Bolker [mailto:bbolker at gmail.com] 
Sent: Wednesday, July 23, 2014 3:06 PM
To: Ravi Varadhan; r-sig-mixed-models at r-project.org
Subject: Re: Providing starting values for glmer()

On 14-07-23 02:18 PM, Ravi Varadhan wrote:
> Dear Ben,
> 
> I would appreciate your help with one more question.  How would I 
> provide starting values to glmer()?  I know it is supposed to be a 
> named list, but I don't know what the names are supposed to be.

 [cc'ing to r-sig-mixed models]

  In the grand tradition of R help pages, I think the definition of 'start' in the ?glmer page is technically correct if somewhat opaque.
Short answer: the names should be 'theta' and/or 'fixef'.


 start: a named list of starting values for the parameters in the
          model, or a numeric vector. A numeric 'start' argument will
          be used as the starting value of 'theta'.  If 'start' is a
          list, the 'theta' element (a numeric vector) is used as the
          starting value for the first optimization step (default=1 for
          diagonal elements and 0 for off-diagonal elements of the
          lower Cholesky factor); the fitted value of 'theta' from the
          first step, plus 'start[["fixef"]]', are used as starting
          values for the second optimization step.  If 'start' has both
          'fixef' and 'theta' elements, the first optimization step is
          skipped. For more details or finer control of optimization,
          see 'modular'.

Since you're fitting a logistic model, large parameter estimates (e.g.
|beta|>10) are strongly suspicious of complete separation (consider the
value of `plogis(41,log.p=TRUE)`); large intercept terms are also diagnostic for continuous predictors that should be centered.  The proximal cause of the convergence warning is most likely that glmer scales the estimated gradients at the MLE by the estimated curvature (inverse Hessian); if the surface is really, really flat then the scaled gradients will be large even if the gradients themselves are OK.

  MCMCglmm and blme give fairly straightforward ways to deal with complete separation (see http://rpubs.com/bbolker/glmmchapter).

  Ben Bolker


> 
> Here is the model I am trying to fit.  As you can see, the model does 
> not converge. I would like to look at different starting values.
> 
> 
> 
>> summary(mod1 <- glmer(imps79b ~ tx*sweek + (sweek|id),data=schiz,
>> family=binomial))
> 
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) ['glmerMod']
> 
> Family: binomial  ( logit )
> 
> Formula: imps79b ~ tx * sweek + (sweek | id)
> 
> Data: schiz
> 
> 
> 
> AIC      BIC   logLik deviance df.resid
> 
> 1206     1244     -596     1192     1596
> 
> 
> 
> Scaled residuals:
> 
> Min      1Q  Median      3Q     Max
> 
> -1.7008  0.0000  0.0000  0.0001  1.3310
> 
> 
> 
> Random effects:
> 
> Groups Name        Variance Std.Dev. Corr
> 
> id     (Intercept) 1143     33.8
> 
> sweek        255     16.0     -0.43
> 
> Number of obs: 1603, groups:  id, 437
> 
> 
> 
> Fixed effects:
> 
> Estimate Std. Error z value Pr(>|z|)
> 
> (Intercept)    41.54       8.50    4.88    1e-06 ***
> 
> tx              5.81       5.12    1.14    0.256
> 
> sweek         -10.91       3.32   -3.28    0.001 **
> 
> tx:sweek      -11.93       5.17   -2.31    0.021 *
> 
> ---
> 
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> 
> 
> Correlation of Fixed Effects:
> 
> (Intr) tx     sweek
> 
> tx       -0.823
> 
> sweek     0.527 -0.289
> 
> tx:sweek -0.734  0.360 -0.922
> 
> Warning message:
> 
> In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,
> :
> 
> Model failed to converge with max|grad| = 73.9422 (tol = 0.001, 
> component 4)
> 
>> 
> 
> 
> 
> Thanks,
> 
> Ravi
> 
> 
> 
> Ravi Varadhan, Ph.D. (Environmental Eng.), Ph.D. (Biostatistics)
> 
> Associate Professor,
> 
> Division of Geriatric Medicine & Gerontology
> 
> School of Medicine,
> 
> Johns Hopkins University
> 
> Ph: 410-502-2619
> 
> Email: ravi.varadhan at jhu.edu <mailto:ravi.varadhan at jhu.edu>
> 
> http://www.jhsph.edu/research/centers-and-institutes/johns-hopkins-cen
> ter-on-aging-and-health/people/Faculty_personal_Pages/Varadhan.html
>
> 
> 
> 
> 



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