Re: [R] lmer(): specifying i.i.d random slopes for multiple covariates

From: Spencer Graves <>
Date: Sun 03 Sep 2006 - 05:05:15 GMT

      The first example in the 'lmer' help page is the following:

     (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))

      If this does not answer your question, please provide commented, minimal, self-contained, reproducible code with your explanation of why and how it does not.

      Hope this helps. 
      Spencer Graves

Fabian Scheipl wrote:
> Dear readers,
> Is it possible to specify a model
> y=X %*% beta + Z %*% b ; b=(b_1,..,b_k) and b_i~N(0,v^2) for i=1,..,k

> that is, a model where the random slopes for different covariates are i.i.d., in lmer() and how?
> In lme() one needs a constant grouping factor (e.g.: all=rep(1,n)) and would then specify:
> lme(fixed= y~X, random= list(all=pdIdent(~Z-1)) ) ,
> that´s how it's done in the lmeSplines- documentation.
> Any hints would be greatly appreciated- I'm trying to write a suite of functions that will transform additive models into their mixed-effects representation like lmeSplines but using lmer() instead of lme().
> Thank you for your time,
> Fabian Scheipl
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun Sep 03 16:18:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:17 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.