[R-sig-ME] Perfectly correlated random effects (when they shouldn't be)

svm steven.v.miller at gmail.com
Wed Jul 15 02:53:01 CEST 2015


Hi all,

I'm a long-time reader and wanted to raise a question I've seen asked here
before about correlated random effects. Past answers I have encountered on
this listserv explain that perfectly correlated random effects suggest
model overfitting and variances of random effects that are effectively zero
and can be omitted for a simpler model. In my case, I don't think that's
what is happening here, though I could well be fitting a poor model in
glmer.

I'll describe the nature of the data first. I'm modeling individual-level
survey data for countries across multiple waves and am estimating the
region of the globe as a random effect as well. I have three random effects
(country, country-wave, and region). In the region random effect, I am
allowing country-wave-level predictors to have varying slopes. My inquiry
is whether some country-wave-level contextual indicator can have an overall
effect (as a fixed effect), the effect of which can vary by region. In
other words: is the effect of some country-level indicator (e.g.
unemployment) in a given year different for countries in Western Europe
than for countries in Africa even if, on average, there is a positive or
negative association at the individual-level? These country-wave-level
predictors that I allow to vary by region are the ones reporting perfect
correlation and I'm unsure how to interpret that (or if I'm estimating the
model correctly).

I should also add that I have individual-level predictors as well as
country-wave-level predictors, though it's the latter that concerns me.
Further, every non-binary indicator in the model is standardized by two
standard deviations.

For those interested, I have a reproducible (if rather large) example
below. Dropbox link to the data is here:
https://www.dropbox.com/s/t29jfwm98tsdr71/correlated-random-effects.csv?dl=0

In this reproducible example, y is the outcome variable and x1 and x2 are
two country-wave-level predictors I allow to vary by region. Both x1 and x2
are interval-level predictors that I standardized to have a mean of zero
and a standard deviation of .5 (per Gelman's (2008) recommendation).

I estimate the following model.

summary(M1 <- glmer(y ~ x1 + x2 + (1 | country) + (1 | country:wave) + (1 +
x1 + x2 | region), data=subset(Data), family=binomial(link="logit")))

The results are theoretically intuitive. I think they make sense. However,
I get a report of perfect correlation for the varying slopes of the region
random effect.

Random effects:
 Groups       Name        Variance Std.Dev. Corr
 country:wave (Intercept) 0.15915  0.3989
 country      (Intercept) 0.32945  0.5740
 region       (Intercept) 0.01646  0.1283
              x1          0.02366  0.1538    1.00
              x2          0.13994  0.3741   -1.00 -1.00
Number of obs: 212570, groups:  country:wave, 143; country, 82; region, 6

What should I make of this and am I estimating this model wrong? For what
it's worth, the dotplot of the region random effect (with conditional
variance) makes sense and is theoretically intuitive, given my data. (
http://i.imgur.com/mrnaJ77.png)

Any help would be greatly appreciated.

Best regards,
Steve

	[[alternative HTML version deleted]]



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