3
$\begingroup$

I'm using Orange dataset to illustrate my question. In this dataset, for each tree, the circumference and age were measured several times. Say we need to find the correlation coefficient between tree circumference and age. Since these two variable include repeated measures. The variables are not iid, so we should not use simple linear regression. I'm using linear mix model to model the data (lme4)

fit<-lmer(circumference~age+(1|Tree), data=Orange)
summary(fit)

below is the output:

Linear mixed model fit by REML ['lmerMod']
Formula: circumference ~ age + (1 | Tree)
   Data: Orange

REML criterion at convergence: 303.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.8781 -0.6743  0.2320  0.5053  1.5416 

Random effects:
 Groups   Name        Variance Std.Dev.
 Tree     (Intercept) 389.6    19.74   
 Residual             232.9    15.26   
Number of obs: 35, groups:  Tree, 5

Fixed effects:
             Estimate Std. Error t value
(Intercept) 17.399650  10.423696   1.669
age          0.106770   0.005321  20.066

Correlation of Fixed Effects:
    (Intr)
age -0.471

In the output, we can see the correlation info (-0.471 in the last line). How to interpret this number? It seems like the correlation between age and (Intr) ? What I need to find is the correlation coefficient between age and circumference, not the fix effect slope. Does anyone know how I can extract the correlation coef? Thanks a lot in advance.

$\endgroup$
  • 1
    $\begingroup$ I am not sure whether a (single) "repeated measure correlation coefficient" exists (in a rigorous sense). Has it been discussed elsewhere in the literature? $\endgroup$ – AdamO Feb 6 '18 at 18:49
0
$\begingroup$

I believe that what you're asking for is the Pearson correlation coefficient, aka "R". This can be derived from the coefficient of determination, or R-squared. You can use the package MuMIn to find the marginal and conditional R-squared values of your model.

"The marginal R squared values are those associated with your fixed effects, the conditional ones are those of your fixed effects plus the random effects. Usually we will be interested in the marginal effects." R squared for mixed models – the easy way; by Philip Martin.

Here's all you need:

library(lme4)
library(MuMIn)

fit<-lmer(circumference~age+(1|Tree), data=Orange)
summary(fit)

r.squaredGLMM(fit)

To understand the "Correlation of Fixed Effects" at the bottom of your summary() output, see the following:

How do I interpret the 'correlations of fixed effects' in my glmer output?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.