I would like to use the function update()to update a random part of my model, in particular, to add a random effect. Most of the examples ( help("update"), help("update.formula"), lme4: mixed effects modeling R ) centered on a fixed part of the model. How do I go from fm0to fm1using update()in the example below?
library(lme4)
(fm0 <- lmer(Reaction ~ Days + (1 | Subject), sleepstudy))
(fm1 <- lmer(Reaction ~ Days + (1 + Days | Subject), sleepstudy))
source
share