Dear all,
I am interested in using lme4 to make subject level predictions from longitudinal data. I have 7 longitudinal observations for over 100 subjects to fit the model (Call it z1), and the goal would be to use info from the first 2 observations of a new subject to make predictions for the remaining 5 time points. One way seems to be to add the first 2 time points of the new subject to the dataset of the other subjects with full longitudinal sets and refit the model to get the required random coefficients for the new subject in order to make predictions. My question is whether refitting the model could be avoided and use info from fitted model z1 as well as the design matrix and response values for the first 2 time points of the new subject to compute its random coefficients so that subject level predictions can be obtained.
See below an illustration using a subset of the entire dataset:
#so straight lines are not good enough, therefore will try some transformations of the time t
dat$X=log(dat$t)
dat$X2=dat$t*log(dat$t)
#fit a mixed model without subject 14
z1=lmer(Y~X+X2+(1+X|ID),data=dat[1:87,])
coef(z1)
#Question:
#Say I only had the first 2 time points for subject 14 and wanted to make
#subject level predictions for it for all time points.
#One way seems to be to fit a new model z2 with by including the first 2 points
# of this subject.
z2=lmer(Y~X+X2+(1+X|ID),data=dat[1:89,])
coef(z2)
#Q1, Is there another way that would not require fitting model z2 but simply use
# info form z1 and
dat[88:89,c("X","X2","Y")]
X X2 Y
88 2.706981 40.56130 2.803360
89 2.843977 48.87079 2.933857
Thanks,
Adi Tarca
________________________________
This document may include proprietary and confidential information. This document may not be reproduced, copied, distributed, published, modified or furnished to third parties, without prior written consent. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.