1
$\begingroup$

I am running a linear mixed effects model in R using the lmer4 package. I was wondering if my data is structured in the right way for this purpose. In a few words I have a response variable "cognitive performance" which is longitudinal (time points 1, 2 and 3). Some participants in this study have only one measurement on this variable at time point 1, some have two time points and some have all three three time points completed.

Then I have the predictor variables (fixed effects) age, baseline IQ, study site and a continuous biomarker variable. This continuous variable is taken only at time point 1 so we are looking to find whether its value at baseline is a good predictor of the change in cognitive performance.

My random effect variable is the subject ID.

My question is: is it adequate to leave the values for the continuous biomarker variable as NAs for time points 2 and 3? When I actually do this, R gives me the error "number of levels of each grouping factor must be < number of observations (problems: subject_label)". I believe this error refers to me not having repeated measurements for the biomarker variable but I might be wrong. My other option would be to copy the baseline measurement of the biomarker variable into time points 2 and 3 as if the measurement stayed the same. Would this lead to adequate conclusions (in reality these biomarkers change through time and our research question looks specifically at their predictive power at baseline measurement)?

Thank you for your help in advance. I hope I have given a good explanation but let me know if you have any further questions.

$\endgroup$
1
  • $\begingroup$ You've explained the study set up quite well, but could you please let us know the formula for the model you are fitting in with lmer. Also please include the output of summary(mydata) and str(mydata) $\endgroup$ Commented Aug 13, 2020 at 10:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.