# Interpreting VarCorr estimates versus cor(ranef()) in lme4 mixed models

I am following-up this and this thread because I found it very difficult to understand the implications of using each of the two types of random-effect correlations. In particular, I fitted model like this

model <- lmer(RT ~ F1*F2 + (F1*F2|subject), data = mydata)

Where F1 and F2 are two binary factors (coded 0 vs. 1) representing manipulations within-subject: each subject does all four experimental conditions defined by F1*F2.

Imagine that F1 is a painful-inducing manipulation (0 = non painful, 1 = painful) and F2 is painkiller (0 = no painkiller, 1 = painkiller). I want to know whether the painkiller is most effective on individuals who are more sensitive to pain without painkillers (i.e., when F2 = 0).

For this reason, I inspected correlations between two random effects: ranef-F1 and ranef-F1:F2. If I got this correctly, a positive correlation implies that individuals who are more sensitive to pain (high ranef-F1) are also those for which the painkiller is most successful (high ranef-F1:F2). What are the implications of testing this hypothesis by inspecting VarCorr(model) versus cor(ranef(model))? Another related issue is: Whereas I can easily get p-values for cor(ranef(model)), I cannot have p-values for VarCorr(model), or can I?

I tried to go through the lme4 paper and through several Questions&Answers, but I could not really understand this point.

Could anyone help me solve this issue?

• You can have confidence intervals for the variances and covariances of the random effects in your lmer model. You can check out Ben Bolker's answer to this thread for an example on how those confidence intervals would be derived: stackoverflow.com/questions/37208542/…. I would imagine you can get p-values as well (e.g., via bootstrapping). – Isabella Ghement Oct 13 '19 at 16:10
• You can also try confint.merMod(model) to get confidence intervals for the correlations between the random effects. – Isabella Ghement Oct 13 '19 at 18:07