Skip to main content
fixed link; formatted; light editing
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

A multilevel model is defined as y = Xβ + Zη + ǫ$y = Xβ + Zη + ǫ$

Thus there are 3 different kinds of residuals:  

  1. Marginal residuals: y − Xβ (= Zη + ǫ)$y − Xβ\ (= Zη + ǫ)$
  2. Conditional residuals: y − Xβ − Zη (= ǫ)$y − Xβ − Zη\ (= ǫ)$
  3. Random effects: y − Xβ − ǫ (= Zη)$y − Xβ − ǫ\ (= Zη)$

Marginal residuals:

  • Should be mean 0, but may show grouping structure
  • May not be homoskedastic!
  • Good for checking fixed effects, just like linear regrregression.  

Conditional residuals:

  • Should be mean zero with no grouping structure
  • Should be homoskedastic!
  • Good for checking normality of ǫ, outliers  

Random effects:

  • Should be mean zero with no grouping structure
  • May not be be homoskedastic!
  • Good for checking normality of , outliers

In R (if results is an mer object), the command residuals(results) gives you the conditional residuals.

# checking the normality of conditional residuals:
qqnorm(resid(results), main="Q-Q plot for conditional residuals")

# checking the normality of the random effects (here random intercept):
qqnorm(ranef(resuls)$Name_of_group_variable$`(Intercept)`, 
       main="Q-Q plot for the random intercept")

 

The answer is partly copied from the following PowerPoint slide deck: http://www.stat.cmu.edu/~brian/463/week07/14%20-%20lmer%20model%20selection%20and%20residuals.pdfpdf.

A multilevel model is defined as y = Xβ + Zη + ǫ

Thus there are 3 different kinds of residuals:  

  1. Marginal residuals: y − Xβ (= Zη + ǫ)
  2. Conditional residuals: y − Xβ − Zη (= ǫ)
  3. Random effects: y − Xβ − ǫ (= Zη)

Marginal residuals:

  • Should be mean 0, but may show grouping structure
  • May not be homoskedastic!
  • Good for checking fixed effects, just like linear regr.  

Conditional residuals:

  • Should be mean zero with no grouping structure
  • Should be homoskedastic!
  • Good for checking normality of ǫ, outliers  

Random effects:

  • Should be mean zero with no grouping structure
  • May not be be homoskedastic!
  • Good for checking normality of , outliers

In R (if results is an mer object), the command residuals(results) gives you the conditional residuals.

# checking the normality of conditional residuals:
qqnorm(resid(results), main="Q-Q plot for conditional residuals")

# checking the normality of the random effects (here random intercept):
qqnorm(ranef(resuls)$Name_of_group_variable$`(Intercept)`, main="Q-Q plot for the random intercept")

 

The answer is partly copied from the following PowerPoint slide deck: http://www.stat.cmu.edu/~brian/463/week07/14%20-%20lmer%20model%20selection%20and%20residuals.pdf

A multilevel model is defined as $y = Xβ + Zη + ǫ$

Thus there are 3 different kinds of residuals:

  1. Marginal residuals: $y − Xβ\ (= Zη + ǫ)$
  2. Conditional residuals: $y − Xβ − Zη\ (= ǫ)$
  3. Random effects: $y − Xβ − ǫ\ (= Zη)$

Marginal residuals:

  • Should be mean 0, but may show grouping structure
  • May not be homoskedastic!
  • Good for checking fixed effects, just like linear regression.

Conditional residuals:

  • Should be mean zero with no grouping structure
  • Should be homoskedastic!
  • Good for checking normality of ǫ, outliers

Random effects:

  • Should be mean zero with no grouping structure
  • May not be be homoskedastic!
  • Good for checking normality of , outliers

In R (if results is an mer object), the command residuals(results) gives you the conditional residuals.

# checking the normality of conditional residuals:
qqnorm(resid(results), main="Q-Q plot for conditional residuals")

# checking the normality of the random effects (here random intercept):
qqnorm(ranef(resuls)$Name_of_group_variable$`(Intercept)`, 
       main="Q-Q plot for the random intercept")

The answer is partly copied from the following PowerPoint slide deck pdf.

Source Link
majom
  • 1k
  • 1
  • 16
  • 28

A multilevel model is defined as y = Xβ + Zη + ǫ

Thus there are 3 different kinds of residuals:

  1. Marginal residuals: y − Xβ (= Zη + ǫ)
  2. Conditional residuals: y − Xβ − Zη (= ǫ)
  3. Random effects: y − Xβ − ǫ (= Zη)

Marginal residuals:

  • Should be mean 0, but may show grouping structure
  • May not be homoskedastic!
  • Good for checking fixed effects, just like linear regr.

Conditional residuals:

  • Should be mean zero with no grouping structure
  • Should be homoskedastic!
  • Good for checking normality of ǫ, outliers

Random effects:

  • Should be mean zero with no grouping structure
  • May not be be homoskedastic!
  • Good for checking normality of , outliers

In R (if results is an mer object), the command residuals(results) gives you the conditional residuals.

# checking the normality of conditional residuals:
qqnorm(resid(results), main="Q-Q plot for conditional residuals")

# checking the normality of the random effects (here random intercept):
qqnorm(ranef(resuls)$Name_of_group_variable$`(Intercept)`, main="Q-Q plot for the random intercept")


The answer is partly copied from the following PowerPoint slide deck: http://www.stat.cmu.edu/~brian/463/week07/14%20-%20lmer%20model%20selection%20and%20residuals.pdf