[R-sig-ME] Updating fit with lmer()

Douglas Bates bates at stat.wisc.edu
Tue Aug 3 20:25:19 CEST 2010


On Mon, Jul 26, 2010 at 3:31 PM, Gang Chen <gangchen6 at gmail.com> wrote:
> Suppose I run a linear mixed-effects model such as
>
> (fm <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
>
> and I want to update the fitting with a new response data (e.g.,
> newReaction) with everything else the same as the original model. Dr. Bates
> suggested the following on Sept. 5, 2007 to save runtime:
>
>> After fitting the model to the first simulated response, producing the
> object 'fm',  the only operations needed to update the model are
>>
>> fm at y <- newy
>> Xy <- cbind(fm at X, fm at y)
>> fm at ZtXy <- fm at Zt %*% Xy
>> fm at XytXy <- crossprod(Xy)
>> lme4:::mer_finalize(fm, verbose)
>
> However, I could not find slots fm at ZtXy and fm at XytXy any more in lme4 nor
> lme4a. Have these two slots been changed to different names?

Indeed, things have changed since then.

> Or essentially the above steps have been wrapped into refit() in lme4?

Yes.




More information about the R-sig-mixed-models mailing list