[R] Penalized Splines as BLUPs using lmer?
Matthias Kormaksson
mk375 at cornell.edu
Thu Apr 13 22:04:42 CEST 2006
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
More information about the R-help
mailing list