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: [EMAIL PROTECTED] on behalf of Matthias Kormaksson Sent: Thu 4/13/2006 4:04 PM To: [email protected] 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 ______________________________________________ [email protected] 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]]
______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
