R-helpers:

I would like to measure the correlation coefficient between the repeated 
measures of a single variable that is measured over time and is unbalanced.  As 
an example, consider the Orthodont dataset from package nlme, where the model 
is:

fit <- lmer(distance ~ age + (1 | Subject), data=Orthodont)

I would like to measure the correlation b/t the variable "distance" at 
different ages such that I would have a matrix of correlation coefficients like the 
following:

      age08 age09 age10 age11 age12 age13 age14
age08    1
age09          1
age10                1
age11                      1
age12                            1
age13                                  1
age14                                         1

The idea would be to demonstrate that the correlations b/t repeated measures of the variable "distance" decrease as the time b/t measures increases. For example, one might expect the correlation coefficient b/t age08 and age09 to be higher than that between age08 and age14.
Is there a function that can calculate such correlation coefficients of a repeatedly measured variable "y" 
("distance" in the Orthodont dataset) across some category "x" ("age" in the Orthodont 
dataset)?

Thanks,

Brant
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to