# Linear mixed effects model (lmer) gives singular fit: Why does the simpler model not converge?

I have the following design: Participants are randomly assigned to either a control group $$C$$ or an intervention group $$I$$. Each participant is measured at two times, $$T_0$$ and $$T_1$$. At each time point, each participant is measured three times. The dataset looks like this:

$$\begin{array}{c|c|c|c|c} y & \text{ID} & \text{Group} & \text{Time} & \text{Repetition} \\ \hline \ldots & 1 & C & 0 & 1 \\ \ldots & 1 & C & 0 & 2 \\ \ldots & 1 & C & 0 & 3 \\ \ldots & 1 & C & 1 & 1 \\ \ldots & 1 & C & 1 & 2 \\ \ldots & 1 & C & 1 & 3 \\ \ldots & 2 & I & 0 & 1 \\ \ldots & 2 & I & 0 & 2 \\ \ldots & 2 & I & 0 & 3 \\ \ldots & 2 & I & 1 & 1 \\ \ldots & 2 & I & 1 & 2 \\ \ldots & 2 & I & 1 & 3 \\ \ldots & \ldots & \ldots & \ldots \\ \end{array}$$

A descriptive graph of the data is here:

Each participant has its own color and the points are slightly dodged for each participants. The lines connect the individual and time-specific means for each participant.

I want to fit a linear mixed effects model to these data with the following fixed and random effects:

• Fixed effects for $$\text{Group}$$ and $$\text{Time}$$, together with an interaction between the two ($$\text{Group}\times\text{Time}$$).
• A random intercept for $$\text{ID}$$
• A random intercept for $$\text{Repetition}$$

Because each participant has three measurements at each time point, I would think that $$\text{ID}$$ and $$\text{Repetition}$$ are crossed, not nested random effects.

Using lmer from the lme4 package:

lmer(y~Time*Group + (1|ID) + (1|Repetition), data = dat)

Random effects:
Groups     Name        Std.Dev.
ID         (Intercept) 561.4
Repetition (Intercept)   0.0
Residual               494.0
Number of obs: 108, groups:  ID, 21; Repetition, 3
Fixed Effects:
(Intercept)         TimeT1         GroupK  TimeT1:GroupK
1758.2         -266.0         -262.0          140.3


However, this results in a singular fit with the variance of Repetition being $$0$$. If I fit a random intercept for $$\text{Repetition}$$ separately for each $$\text{Time}$$, the model converges:

lmer(y~Time*Group + (1|ID) + (1|Repetition:Time), data = dat)

Random effects:
Groups          Name        Std.Dev.
ID              (Intercept) 561.33
Repetition:Time (Intercept)  50.86
Residual                    491.96
Number of obs: 108, groups:  ID, 21; Repetition:Time, 6
Fixed Effects:
(Intercept)         TimeT1         GroupK  TimeT1:GroupK
1756.7         -264.5         -261.3          139.6


Even if I fit seperate intercepts for $$\text{ID}$$ per time, the model converges:

mod <- lmer(y~Time*Group + (1|ID:Time) + (1|Repetition), data = dat_mono2)

Random effects:
Groups     Name        Std.Dev.
ID:Time    (Intercept) 609.0
Repetition (Intercept)  29.1
Residual               442.9


I can't wrap my head around why it works in these cases. Hence my questions:

1. Why does the second model converge and the first one not?
2. What would an appropriate random effects structure be for this design?

Edit

I simulated some values according to my design and the model converged with no problems and it successfully recovered the parameters of the simulation. This indicates to me that the model could converge in theory but doesn't because the variance of $$\text{Repetition}$$ is quite small. It's still a mystery why the more complex model does converge with my data, however.

• A singular fit means the model was unable to estimate a non-zero variance component. Maybe the added information of time disentangled the observations such that it became possible to estimate. In addition, even in the model without a singular fit, the estimated variance of repetition is an order of magnitude smaller than that of ID or the residual variance. Apr 14, 2021 at 13:58
• @FransRodenburg Very good points, thanks Frans. I guess I'm wondering if the singular fit is due to a really really small variance of Repetition or a consequence of the design, so to speak. In other words: If the variance of Repetition would be larger, would the model converge or does the design forbid such a model in any case. Apr 14, 2021 at 14:01
• @FransRodenburg what does "non-zero variance component" mean exactly? Does it mean it's the same as another effect? Apr 14, 2021 at 14:18
• @RoroMario It means that the model estimated the variance of the random intercept of Repetition to be 0. So it wasn't able to estimate a non-zero variance for this component. Apr 14, 2021 at 14:20
• Ah, I see. Thanks for the explanation @COOLSerdash ! Apr 14, 2021 at 14:22