[R-sig-ME] testing for a significant correlation between random slopes

Jaime Ashander jashander at ucdavis.edu
Thu Dec 18 23:31:03 CET 2014


Hi Bill,

The intuitive approach you propose makes sense to me. I'd think one could
specify such a model along the same lines as random effects on both slope
and intercept but with no correlation. In lme4 (see 3.2.2 of Bates's lme4
book) this would be:

library(lme4)
#don't use REML when comparing models
fit.rgr2_corr <- lmer(log(TotalDM) ~ t + starchR + t:starchR + ( t +
t:starchR | Sp),
 data=dianna, REML=FALSE)
fit.rgr2_nocorr <- lmer(log(TotalDM) ~ t + starchR + t:starchR + ( t | Sp)
+ (0 + t:starchR | Sp),
   data=dianna, REML=FALSE)
anova(fit_rgr2_corr, fit.rgr2_nocorr)

Note this also specifies zero correlation for the interaction term with the
intercept, but estimates a correlation between t and the intercept. I'm not
sure of a way to get around 'giving' the intercept to one of these terms
but maybe someone will chime in with an alternative.

Cheers,

- Jaime

------------------------------
>
> Message: 2
> Date: Thu, 18 Dec 2014 12:37:22 -0500
> From: "Bill Shipley" <bill.shipley at usherbrooke.ca>
> To: <r-sig-mixed-models at r-project.org>
> Subject: [R-sig-ME] testing for a significant correlation between
>         random  slopes
> Message-ID: <00af01d01ae9$47d11010$d7733030$@usherbrooke.ca>
> Content-Type: text/plain; charset="UTF-8"
>
> Hello.  I am fitting a 2-level mixed model using the lme() function
> involving two independent variables (?t? and ?starchR?) in which the
> intercept, both slopes and the interaction of the two slopes is also
> random:
>
>
>
> fit.rgr2<- lme(log(TotalDM)~t+starchR +
> t:starchR,random=(~t+t:starchR|Sp),data=dianna)
>
>
>
> The model converges normally without any warning messages.  All of the
> fixed
> terms are clearly different from zero. Mmy working hypothesis requires that
> there also be a negative between?group correlation between the slope of ?t?
> and the interaction term (i.e. groups whose slope for ?t? is high at low
> values of ?starchR? have this slope decrease more rapidly as ?starchR?
> increases).  When I fit the above mixed model using the lme() function, I
> indeed find a strong negative correlation of -0.867; here is the relevant
> part of the output from summary:
>
>
>
> StdDev Corr
>
> (Intercept) 1.650783941 (Intr) t
>
> t 0.055870605 -0.124
>
> t:starchR 0.000309582 -0.340 -0.867
>
> Residual 0.337147863
>
>
>
> However, there are only 20 groups and I know that large absolute
> correlations between parameters can arise if the model is
> overparameterized.
>
>
>
> Question: how can I determine if the value of -0.867 is really different
> from zero?
>
>
>
> Intuitively, I would fit another model in which the covariance between the
> random components of ?t? and ?t:starchR? is constrained to be zero and then
> compare the two models via their likelihoods, but I don?t know how to fit
> such a constrained model in either lme() or lmer().
>
> Any help or pointers to relevant literature would be appreciated.
>
> Thanks.
>
>
>
> Bill Shipley
>
> Laboratoire d??ologie Fonctionnelle
>
> D?rtement de biologie, Universit?e Sherbrooke, Sherbrooke (Qc) Canada
> J1K 2R1
>
> (819) 821-8000, poste 62079
>
> Fax: (819) 821-8049
>
>  <http://www.billshipley.recherche.usherbrooke.ca/>
> http://www.billshipley.recherche.usherbrooke.ca/
>
>
>
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list