I think you want the random effects to be independent. If so then you need

lmer(response ~ time +(time|id) + (time-1|id), data)

Harold



-----Original Message-----
From:	r-help-bounces@stat.math.ethz.ch on behalf of Matthias  Kormaksson
Sent:	Thu 4/13/2006 4:04 PM
To:	r-help@stat.math.ethz.ch
Cc:	
Subject:	[R] Penalized Splines as BLUPs using lmer?

Dear R-list,

Iīm trying to use the lmer of the lme4 package to fit a linear mixed model
of the form

Y = Xb + Zu + e

and I canīt figure out how to control the covariance structure of u. I want
u ~ N(0,sigma^2*I).

More precisely Iīm trying to smooth a curve through data using the
"Penalized Splines as BLUPs" method as described in Ruppert, Wand &
Carroll (2003).

So I have Z = [Z1 Z2 ... Z11] where Z1,...,Z11 is a linear spline basis and
X = [1 t] where t is time column in my case.

I have tried various things and read a lot of the online literature but I
canīt seem to find anything useful. I know the old way of fitting this
using lme is:

fit <- lme(y~-1+X,random=pdIdent(~-1+Z))

and then extracting the u vector with

u.hat <- unlist(fit$coef$random)

Is there anyone who could possibly help me and provide me with a code
using the lmer? Is it possible to fit this using lmer without specifying
the Z and the X matrix and instead just use the columns t and Z1, Z2, ...,
Z11?

Thanks in advance,
Matthias


************************
Matthias Kormaksson,
Ph.D Student,
Department of Statistics,
Cornell University

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




	[[alternative HTML version deleted]]

