Skip to content
Prev 20329 / 20628 Next

Implications of modeling residuals in multilevel models

On 2023-12-22 4:50 p.m., Simon Harmel wrote:
Ideally the *marginal* (overall) distribution of *predictions* 
should match the marginal distribution of the response variable (this is 
what the 'posterior predictive check' panel of 
performance::check_model() does).  If the marginal distribution of your 
data is skewed, then the marginal distribution of your prediction should 
be skewed in the same way -- if it's not, then it's not doing a good job 
describing the data.

m <- lm(mpg ~ cyl + disp, mtcars)
performance::check_model(m, check = "pp_check")

   This is a different story from the *residuals* (which tell you 
something about the conditional distribution, not the marginal 
distribution ...)