[R-sig-ME] addressing singularity in lme4 fits caused by subsets of contrasts

Nathan Tardiff nt@rd||| @end|ng |rom @@@@upenn@edu
Thu Jan 21 17:54:58 CET 2021

I have encountered an issue a couple times recently when fitting models in
lme4 that I have not seen addressed in commonly cited papers for dealing w/
boundary/singular fit issues.

Say I have a categorical variable representing a set of within-subject
contrasts, which is entered into the model as a set of effect coded
variables, e.g.

df$congruent.f <- factor(df$congruent,levels=c(1,0,-1),
contrasts(df$congruent.f) <- contr.sum(3)

which will produce two variables in the model (e.g. congruent.f1,
congruent.f2). When I fit the model w/ random intercepts and slopes for
these contrasts (along w/ other control variables), I get a boundary
(singular) fit warning.

Examining the correlations and variance components suggests that the
primary cause of the warning is in one of these contrast variables (e.g.
congruent.f2). So, would it ever be acceptable in this scenario to remove
the random effect term ONLY for congruent.f2, not the entire set of
congruent.f contrasts, where the goal is statistical inference and I do not
want the p-values/confidence intervals for congruent.f1 to be
anticonservative when it does in fact show variance across subjects?

I have to this point assumed that this would be a bad idea and tried to
simplify such models in other ways (i.e. setting correlations to zero or
removing other random effects), but this does not always work and seems a
roundabout method if you are not dealing with the primary problem.


	[[alternative HTML version deleted]]

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