This is a topic for questions, answers, and discussions about session 19 of the Biostatistics for Biomedical Research web course airing on 2020-06-11. Session topics and a link to the course notes with audio narration are listed here. The session covers analysis of serial data (longitudinal data).
I would like to do a correlation analysis of two variables that were measured in a longitudinal study. To my understanding, the usual correlation analysis cannot be used here due to the samples being not independent. What can I do here?
Is it right to run a linear mixed model such as below (example written in lme4 style):
lmer(varA ~ varB + (1|subject), data = data)
And then calculate the intraclass correlation? Would this be a valid approach to get a repeated-measures correlation?
You’ll probably get more help from time series methods. I’m not sure if using a random effects model will be as effective as computing the per-subject Spearman or linear correlation coefficient and then treating them as raw data. Your research seems to be calling for cross-correlation analysis.