2
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ 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$. $\endgroup$ Commented Jul 30 at 19:10
  • $\begingroup$ Yeah I believe it would be more complicated. But is there any at all? $\endgroup$
    – 温泽海
    Commented Jul 30 at 19:12
  • $\begingroup$ 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). $\endgroup$
    – PBulls
    Commented Jul 30 at 21:15

1 Answer 1

1
$\begingroup$

The practicality of such a rule of thumb would be questionable at best. Even for ordinary linear models, different text books will provide different rules of thumb, see the excellent discussion here for example.

I don't think a simple (meaningful) rule of thumb can exist for mixed models. Consider crossed random effects, nesting, random slopes, correlation between random effects. All of these will, to varying extents, affect the required sample size. And that is only considering the random structure.

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:

And finally, while not a rule of thumb, there are several posts with references to useful packages outlining simulation based approaches are better than rules of thumb [1], [2], [3].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.