-
Notifications
You must be signed in to change notification settings - Fork 163
pwrssUpdate error with gamma glmer #573
Description
I am having an issue running glmer, namely:
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GHrule(0L), compDev = compDev, : pwrssUpdate did not converge in (maxit) iterations
From what I’ve read online, it seems this error can indicate issues in the dataframe/model specification rather than being an issue of maxit being too low. Would you mind having a look at the data attached, the glmer command below and seeing if any clear error jumps out? I would be extremely grateful as I’ve tried many things already (see bullet points below!).
I am predicting a very skewed score of childhood mental health, the CBCL, from sex and birthweight. Children are nested within families which are nested within testing site.
m2 <- glmer(cbcl ~ sex + bw_kgs + sex:bw_kgs + (1|site_id/family_id),
data = d,
family = Gamma(link=identity),
control = glmerControl(optimizer = "bobyqa" ,
optCtrl = list(maxfun= 100000)),
nAGQ = 0,
verbose = 1)
Interestingly, the model previous to this (m1) included just sex and the random effects, and ran fine.
Things I’ve tried:
- switching optimiser from bobyqa to nloptwrap
- Standardizing birthweight (bw_kgs)
- Removing NAs rows from the data (NAs in any predictor or the outcome)
- Scaling the outcome without centering it (as this would involve 0s, which glmer can’t seem to handle)
- Winsorizing high values of the outcome, cbcl
Some of these experiments resulted in a different but related error:
Error in (function (fr, X, reTrms, family, nAGQ = 1L, verbose = 0L, maxit = 100L, : (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate
Hope someone can help!
Thanks.
data4github.xlsx