0

This is a study in which 3 mice were used as control, and 3 were mutant. >2000 measurements were taken per mouse. I want to fit a model as follows:

lmer(measurements ~ mouseID + (mouseID|treatment), data = alldata, REML = TRUE)

but this does not converge. I have tried modifying control using Nelder-Mead Method, and L-BFGS-B. Different models give different error messages.

The simple model above yields:

Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : unable to evaluate scaled gradient

Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 7 negative eigenvalues

and the most "complex" if you will, model:

lmer(measurements ~ mouseID + (mouseID|treatment), data = alldata, control = lmerControl( optimizer ='optimx', optCtrl=list(method='L-BFGS-B')), REML = FALSE)

yields:

boundary (singular) fit: see ?isSingular

and there was at least one more warning with another model attempted. Is my problem that the mice did not also receive the other treatment? And if so, how would I adjust the model to reflect what did already happen AND converge?

I am of the impression that the random effect should be the treatment, and the fixed effect is the mouseID. Maybe my desired model is misnamed? Or maybe I have this random/fixed effect thought process wrong. Please advise.

kriggs
  • 11
  • 1
  • If this is a **nested model** (i.e. "treatment" = {control, mutant} varies across mice but not within mice), then you should probably follow the advice of Murtaugh (2007) and compute means per mouse; Murtaugh, Paul A. “Simplicity and Complexity in Ecological Data Analysis.” Ecology 88, no. 1 (2007): 56–62. – Ben Bolker Jun 14 '22 at 20:13

1 Answers1

1

If I'm interpreting correctly, you're looking for the effect of treatment on mice, where the mouse ID is the random effect. Have you tried lmer(measurements ~ treatment + (1|mouse_ID), data = alldata, REML = TRUE)? This is usually how random effects models are formulated in lmer. It is difficult to answer your question without more info about your study design/objectives.

SarahS
  • 121
  • 9
  • 1
    Yes that'd be a random intercepts model. If you want random slopes for each `mouseID` as well, you need to use `measurements ~ (treatment|mouse_ID)`. – qdread Jun 14 '22 at 18:27