Hey everyone,

I want to obtain the correlation matrix of three time-varying variables within individuals. To make it more concrete: I have data on three variables (X, Y and Z) that were measured repeatedly for up to 40 measurement occasions in 50 participants (multilevel structure). I would now like to get some sort of correlation matrix that shows the relation of these three variables within individuals across time.

If I am correct, I can get the within-person correlations by centering the variables on their respective person-means and simply correlate the centered variables afterwards. This should result in the correct point estimate for this correlation. But what are the associated degrees of freedom? I can think of something like (t-2)*N, so in the present example (40-2)*50, but this is more an educated guess than actual knowledge. Also, I think that - even if this formula is correct - it should only hold in a balanced design (i.e., no missing values). Of course, I could use bootstrapping but maybe there is a more elegant solution.

I know that Mplus gives the within- and between-person correlations, but I was wondering if there is a way to compute them with other statistical packages (preferably in R).

Does anybody here have an idea how the degrees of freedom could be computed? Also, if my core premise is wrong (within-person correlation = correlation of person-mean centered variables) I'd also be happy if somebody could correct me.

Best,

Andreas

More Andreas B. Neubauer's questions See All
Similar questions and discussions