[R-sig-ME] Design Matrix for Random effects

W Robert Long longrob604 at gmail.com
Tue May 28 19:55:30 CEST 2013


Hi Steve

That's great. Thanks a lot :-)

RL

On 28/05/2013 18:29, Steve Walker wrote:
> Hi Robert,
>
> In stable (i.e. cran) lme4, Zt can be obtained without fitting the model
> using this command:
>
> lmer(Reaction ~ Days + (Days|Subject), data=sleepstudy, doFit =
> FALSE)$FL$trms[[1]]$Zt
>
> In development (i.e. github) lme4, you can use this command:
>
> lFormula(Reaction ~ Days + (Days|Subject), data=sleepstudy)$reTrms$Zt
>
> or these two:
>
> dv <- lmer(Reaction ~ Days + (Days|Subject), data=sleepstudy, devFunOnly
> = TRUE)
> environment(dv)$pp$Zt
>
> Cheers,
> Steve
>
>
>
>
> On 2013-05-28 12:44 PM, W Robert Long wrote:
>> Hi all
>>
>> I would like to obtain the design matrix for the random effects,
>> without running (g)lmer first.
>>
>> Could anyone help me do that ? For example, working with the
>> sleepstudy dataset
>>
>> sm1 <- lmer(Reaction ~ Days + (Days|Subject), data=sleepstudy)
>>
>> sm1 at Zt is the transpose of the matrix I require, but I would like to
>> obtain it without running lmer.
>>
>> Thanks
>> Robert Long
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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