0

Is there a way in nlme or lmer (or any other mixed modeling package in r) to fit a mixed model where the parameter values for the fixed effects are set and only the random effects are fit by the model?

I can find documentation explaining how to set the intercept 0, but not to set values for fixed effects.

(Yes I do realize this is an odd thing to want to model, but I do have a good reason for doing it)

SEGilman
  • 13
  • 5
  • You can pre-process your dependent variable by partialling out the fixed effects from the DV prior to fitting the model. – Weihuang Wong May 31 '18 at 13:49
  • Weihuang - would this be the same as running the model on the residuals after the fixed effects have been calculated? – SEGilman May 31 '18 at 21:57
  • I think you can use the `offset` function: ie `lmer(Reaction ~ 1 + offset(5*Days) + (1|Subject), sleepstudy)` to set slope to 5. (which may be the same as fitting `lmer(I(Reaction - 5*Days) ~ 1 + (1|Subject), sleepstudy)` – user20650 Jun 01 '18 at 16:28

0 Answers0