[R-sig-ME] categorical random effects correlation in lme4

Malcolm Fairbrother M.Fairbrother at bristol.ac.uk
Tue May 21 19:30:00 CEST 2013


Dear Andrew,

What if you drop the "0 +" bit? So:

 lmer(DI ~ first_di + factor(white) + (factor(white) | primary_ther),
rem3post, REML=F)

or

 lmer(DI ~ first_di + white + (white | primary_ther), rem3post, REML=F)

Including "0 +" means you're not estimating a random intercept for
"primary_ther", which it sounds like you need/want. Instead, you're
getting two random slopes, which I guess are perfectly correlated
because they're two sides of the same coin (the coin being your binary
dummy variable "white").

If that doesn't solve the problem, it might help for you to post the
results of "str(rem3post)" (i.e., your dataset) as well.

Cheers,
Malcolm




> Date: Tue, 21 May 2013 11:41:04 -0400
> From: Andrew McAleavey <andrew.mcaleavey at gmail.com>
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] categorical random effects correlation in lme4
>
> Hi,
>
> I'm currently investigating a question of relative effectiveness of
> therapists, and the particular question is whether some therapists are
> differentially effective with white versus racial/ethnic minority clients
> (this is coded as a binary variable called "white" in this data). We have
> conceptualized this as a cross-level random effect, so the model has one
> random effect for therapist intercept and one effect for the difference in
> effectiveness between their white and nonwhite clients.
>
> I am relatively new to lme4, but I think I have specified the model
> correctly (the fixed effects represent client pretreatment severity and the
> nonsignificant fixed effect of binary race; they don't seem to impact the
> estimation problem). Here's the model of interest:
>>print(fm1_ml <- lmer(DI ~ first_di + white + (0 +
> factor(white)|primary_ther), rem3post, REML=F), corr=F)
>
> The problem is that the two random effects are appearing to correlate at r
> = 1.000. I think this is an estimation problem, and probably indicates that
> the random variables aren't accounting for all that much variance. I'm
> dubious of interpreting this model, therefore. However, when comparing it
> to the random intercepts only model using the LRT, there is a significant
> difference, suggesting that even though the explained variance is (very)
> small, it may be worth including:
>> anova(fm1_a_ml, fm1_ml)
> Data: rem3post
> Models:
> fm1_a_ml: DI ~ first_di + factor(white) + (1 | primary_ther)
> fm1_ml: DI ~ first_di + factor(white) + (0 + factor(white) | primary_ther)
>                 Df    AIC      BIC      logLik     Chisq    Chi Df
> Pr(>Chisq)
> fm1_a_ml   5    4982.7  5011.3  -2486.3
> fm1_ml      7    4979.9   5019.9  -2482.9  6.7871      2        0.03359 *
>
> My question is basically this: How should I interpret these results? There
> are significant differences between therapists in terms of their relative
> effectiveness with white vs. nonwhite clients, but they're just small? Or
> is even this not justified? Would it be safer to say that there are likely
> no estimable differences? Am I missing something else?
>
> Thanks a lot,
> Andrew McAleavey
>
> Here's the model of interest output:
>> print(fm1_ml <- lmer(DI ~ first_di + factor(white) + (0 +
> factor(white)|primary_ther), rem3post, REML=F), corr=F)
> Linear mixed model fit by maximum likelihood
> Formula: DI ~ first_di + factor(white) + (0 + factor(white) | primary_ther)
>    Data: rem3post
>   AIC  BIC logLik deviance REMLdev
>  4980 5020  -2483     4966    4983
> Random effects:
>  Groups       Name              Variance        Std.Dev.   Corr
>  primary_ther factor(white)    0 0.0417050  0.204218
>                  factor(white)1     0.0044086     0.066397   1.000
>  Residual                            0.5099596     0.714115
> Number of obs: 2263, groups: primary_ther, 192
>
> Fixed effects:
>                      Estimate Std. Error t value
> (Intercept)        0.45138    0.06007   7.514
> first_di             0.48009    0.02360   20.338
> factor(white)1   0.01140    0.03298   0.346
>
> --
> Andrew McAleavey, M.S.
> Department of Psychology
> The Pennsylvania State University
> 346 Moore Building
> University Park, PA 16802
> aam239 at psu.edu



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