[R-sig-ME] Model failed to converge when a factor is centered or releveled
Chao Han
h@nch@o @end|ng |rom ude|@edu
Fri Mar 15 01:37:49 CET 2019
Thank you, David. Does that mean I can trust the model?
On Tue, Mar 12, 2019 at 8:57 PM David Duffy <
David.Duffy using qimrberghofer.edu.au> wrote:
> These jobs run for me giving those warnings, but when I plot the re's from
> both models they seem to be identical, and have converged to the same
> likelihood. I guess it is just that the contrast coding leads to numerical
> differences that upset the diagnostics,
>
>
>
> ________________________________________
> From: R-sig-mixed-models [r-sig-mixed-models-bounces using r-project.org] on
> behalf of Chao Han [hanchao using udel.edu]
> Sent: Sunday, 10 March 2019 12:26 PM
> To: R-sig-mixed-models using r-project.org
> Subject: [R-sig-ME] Model failed to converge when a factor is centered or
> releveled
>
> Hi all,
>
> I'm running a mixed-effects model using lmer4::glmer() function. The
> modeling works with R's default dummy coding. But if I center or relevel a
> factor of 2 levels, the model failed to converge. I am wondering why.
>
> Here is the data:
> https://www.dropbox.com/s/ysw5rvxowamucoh/example.csv?dl=0
>
> Here is the code for the model without centering or releveling the factor
> "Memory":
>
> > model_default <- glmer(ACC ~ Memory * Group + (1|Subject) +
> (1+Memory|item), family = "binomial", data = df)
>
> The model converges with the above code. But the following model failed to
> converge after centering the factor "Memory":
>
> > c1 <- c(-0.5, 0.5)
> > contrasts(df$Memory) = cbind(c1)
> > model_center <- glmer(ACC ~ Memory * Group + (1|Subject) +
> (1+Memory|item), family = "binomial", data = df)
>
> If I relevel the factor "Memory", the following model failed to converge
> either:
>
> > df$Memory <- factor(df$Memory, levels = c("Y", "X"))
> > model_relevel <- glmer(ACC ~ Memory * Group + (1|Subject) +
> (1+Memory|item), family = "binomial", data = df)
>
> Why would centering or releveling a factor make a difference in terms of
> convergence? Which result should I trust?
>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list