# Rule of Thumb for Mixed Model

Suppose that we have $$n$$ observations of $$(X,Y)$$ pair, where $$X$$ are real (might be vectors), and $$Y$$ is real. We want to a linear model. One rule of thumb is that the number of learnable parameters excluding the intercept should not exceed $$\frac{n}{10}$$. It is not that we do not do it if each learnable parameter only has $$9$$ observations, but it is a way to prevent overfit.

Is there a similar rule of thumb for mixed models? To take a simple example, suppose that $$X \in \mathbb{R}^n$$ and $$Y \in \mathbb{R}^n$$ are data, we get a class called patient, which is a factor with say $$k$$ levels. And we wish to do a random intercept:

lmer(Y ~ X + (1 | patient))

Is there a similar rule of thumb to prevent overfit regarding number of learnable parameters, $$n$$, $$k$$ and number of observations for each patient?

• For mixed models, such a rule of thumb could never be as simple as just a function of the number of parameters, because the effective sample size depends not only on the number of patients but also the variance between patients compared to the variance of the error term $\epsilon$. Commented Jul 30 at 19:10
• Yeah I believe it would be more complicated. But is there any at all?
– 温泽海
Commented Jul 30 at 19:12
• It depends on the correlation between within-cluster observations. One rule of thumb I've seen is similar at $n/10$, but $n$ ranges from the total number of observations (low to no correlation) to the number of clusters (very high correlation). Commented Jul 30 at 21:15

If the variance between groups is large enough in comparison to the error variance, you can simplify your rule of thumb by just counting groups ($$k$$), and not observations ($$n$$). With that in mind, some helpful rules of thumb taken from other posts on this site include: