Skip to content

lme4 convergence warnings and confirmatory path analysis with hierarchical data

2 messages · Margaret Metz, Ben Bolker

5 days later
#
Margaret Metz <mrmetz at ...> writes:
Short answer -- I haven't gotten very far into this yet.
It did inspire me to post a utility function for trying out
all known optimizers:

https://raw.githubusercontent.com/lme4/lme4/master/misc/issues/allFit.R

When I try this on your data,

## setwd("~/R/pkgs/lme4git/lme4/misc/issues")
source("path.data.example.R")
library(lme4)
fm1 <- lmer(env1 ~ env2 + env3 + (1|plot) + (1|species), data=data)
source("allFit.R") ## URL above
rr <- allFit(fm1)
rr2 <- rr[!sapply(rr,inherits,"try-error")]
sapply(rr2,fixef)  ## bobyqa, nlminb, L-BFGS-B all give similar fixed effects
sapply(rr2,function(x) unlist(VarCorr(x)))   ## and RE variances
lapply(rr2,function(x) x at optinfo$conv$lme4$messages)  ## all complain
lapply(rr2,function(x) x at optinfo$warnings)

But my results are quite different from yours -- are we using the
same subset of the data?
This message goes away in my local branch, where I scale the
gradient differently
You know what it means, right? (Zero variances/perfect correlations
in the estimated random effects variance-covariance matrix).  I haven't
followed Shipley 2009, but if everything _else_ about your data
were reliable, and if your focus was on the fixed-effect estimates,
I might not worry about it too much.  Or you could remove those
terms from the model.  It really depends a bit more on the context
of your analysis.