[R-sig-ME] deterministic correlation of intercept and slope random effects
Martin Schmettow
schmettow at web.de
Fri Aug 19 17:18:46 CEST 2011
MCMC? I thought that was dropped in current versions of lme4.
Instead I run the same model in MCMCglmm:
MCMCglmm(LR~ Culture+Perspective+Instruction+Culture:Perspective,
random=~us(1+Perspective):Subj,data=cardin, family="poisson")
This terminates with an error: "Error in MCMCglmm(LR ~ Culture + Perspective
+ Instruction + : ill-conditioned G/R structure: use proper priors if you
haven't or rescale data if you have"
If I change the random effects term to intercept only (random=~Subj) then it
runs smoothly, but gives somewhat different parameter estimates.
In my paper I write now:
" We can think of two reasons how this may happen: either the model is
over-parameterized or the numerical optimization is trapped in a local
maximum. To be on the safe side we decided to proceed by dropping the random
slope from the model."
Thanks everybody for the help. This was the first time for me to ask on this
list and I am very impressed by the quick and good responses.
CU, Martin.
> -----Original Message-----
> From: S Ellison [mailto:S.Ellison at LGCGroup.com]
> Sent: Wednesday, August 17, 2011 6:13 PM
> To: Martin Schmettow
> Subject: RE: [R-sig-ME] deterministic correlation of intercept and slope
> random effects
>
> Wiser heads may also contribute, but I encountered a ssuspiciously exact
> correlation myself not long ago. Turned out that with a comparatively
small
> data set the optimiser had run up against the outer limits of correlation
and
> the data were insufficient to pull it back.
>
> So the optimiser might have fallen down a hole it couldn;t dig itself out
of.
>
> If you can have a look at an MCMC run on the model, see if any parameter
> distributions show unexpected second nodes near zero (or, in your case, -1
if
> you can see the correlation terms in the MCMC).
>
> Not sure there's a solution, though; if getting more data was easy, I'd
have
> had it already.
>
> S Ellison
>
> > -----Original Message-----
> > From: r-sig-mixed-models-bounces at r-project.org
> > [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Martin
> > Schmettow
> > Sent: 17 August 2011 10:28
> > To: r-sig-mixed-models at r-project.org
> > Subject: [R-sig-ME] deterministic correlation of intercept and slope
> > random effects
> >
> > Dear group members,
> >
> >
> >
> > Using lme4 for a poisson regression I found an odd effect:
> > the correlation between random intercept and random slope is exactly
> > -1.
> >
> >
> >
> > Currently, I analyze a data set from an experiment on cultural
> > differences in describing navigational routes. The outcome variables
> > are counts of verbal descriptors (like left-right descriptors, e.g.
> > "turn right"). There are three dichotomous predictors: Culture,
> > Instruction and Perspective.
> > Each subject was tested once in each of both Perspective conditions.
> >
> >
> >
> > I started by determining whether a slope random effect was needed in
> > addition to the random intercept. This was done by comparing the AIC
> > of the following two models:
> >
> >
> >
> > mr1<-lmer(LR~Culture*Instruction*Perspective+(1|Subj),data=cardin,
> > family=poisson)
> > mr2<-lmer(LR~Culture*Instruction*Perspective+(1+Perspective|Su
> > bj),data=cardi
> > n, family=poisson)
> >
> >
> >
> > It turned out that the random intercept improves model fit (lower
> > AIC).
> >
> >
> >
> > Then I computed all possible combinations of the three fixed effects
> > and interactions with random slope and intercept and by lowest AIC
> > arrived at:
> >
> >
> >
> > m4c<-lmer(LR~Culture+Instruction+Perspective+Perspective:Cultu
> > re+(1+Perspect
> > ive|Subj),data=cardin, family=poisson)
> >
> >
> >
> > Now, what strikes me is the correlation of exactly -1 between random
> > intercept and slope. Indeed, the negative correlation has a straight
> > forward
> > interpretation: Subjects already using left-right terms a lot are less
> > stimulated by the Perspective condition. But how can there be a
> > complete determination between intercept and slope?
> >
> >
> >
> > Thanks in advance,
> >
> > Martin.
> >
> >
> >
> > Generalized linear mixed model fit by the Laplace approximation
> >
> > Formula: LR ~ Culture + Instruction + Perspective +
> > Perspective:Culture +
> > (1 + Perspective | Subj)
> >
> > Data: cardin
> >
> > AIC BIC logLik deviance
> >
> > 709.3 740.5 -346.7 693.3
> >
> > Random effects:
> >
> > Groups Name Variance Std.Dev. Corr
> >
> > Subj (Intercept) 0.44923 0.67024
> >
> > PerspectiveRoute 0.41462 0.64391 -1.000 Number of obs: 362,
> > groups: Subj, 181
> >
> >
> >
> > Fixed effects:
> >
> > Estimate Std. Error z value Pr(>|z|)
> >
> > (Intercept) 1.78390 0.07249 24.608 < 2e-16 ***
> >
> > CultureDutch 0.49138 0.12595 3.901 9.56e-05 ***
> >
> > InstructionCompass Rose -0.01677 0.04247 -0.395 0.69283
> >
> > PerspectiveRoute 0.63388 0.07205 8.797 < 2e-16 ***
> >
> > CultureDutch:PerspectiveRoute -0.40283 0.13118 -3.071 0.00213 **
> >
> > ---
> >
> > Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> >
> >
> >
> > Correlation of Fixed Effects:
> >
> > (Intr) CltrDt InstCR PrspcR
> >
> > CultureDtch -0.534
> >
> > InstrctnCmR -0.303 0.038
> >
> > PerspectvRt -0.889 0.511 0.005
> >
> > CltrDtch:PR 0.488 -0.929 -0.001 -0.549
> >
> >
> >
> >
> >
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
> **********************************************************
> *********
> This email and any attachments are confidential. Any u...{{dropped:9}}
More information about the R-sig-mixed-models
mailing list