Skip to content
Prev 12799 / 20628 Next

testing for a significant correlation between random slopes

Jaime Ashander <jashander at ...> writes:
I suppose you could use

(1|Sp) + (0+t|Sp) + (0+t:starchR|Sp)

It's important to distinguish between categorical and continuous
predictors here: if t and starchR are both continuous (as suggested
by the use of the word 'slopes' below), this should work.  If either
is categorical this will be a bit trickier (I believe the ?lmer
page gives an example -- basically, you have to set up your own
dummy variables).

  As far as using REML vs ML for contrasts -- Tove is true that
REML generally gives less-biased estimates of the RE variances,
and it should be OK to do a (restricted) likelihood ratio test
between REML-fitted models that differ only in their random effects.
I don't actually know of any explicit comparisons that explore
the power/type I error of REML vs ML-based tests of this type.

Alternatively,

* You could probably use the nlme package's "pdDiag" class
to set up your own diagonal variance-covariance matrix.
* You could look at the 95% profile confidence intervals on the
correlation (?confint.merMod) and see if they overlap zero or not.
[snip]
[snip]