Last data update: 2014.03.03

R: Diagnostic tools for hierarchical (multilevel) linear models
HLMdiagR Documentation

Diagnostic tools for hierarchical (multilevel) linear models

Description

HLMdiag provides a suite of diagnostic tools for hierarchical (multilevel) linear models fit using lmer or lme. These tools are grouped below by purpose. See the help documentation for additional information about each function.

Details

Residual analysis

HLMdiag's HLMresid function provides a convenient wrapper to obtain residuals at each level of a hierarchical linear model. In addition to being a wrapper function for functions implemented in the lme4 package, HLMresid provides access to the marginal and least squares residuals (through LSresids) that were not previously implemented.

Influence analysis

Influence on fitted values

HLMdiag provides leverage that calculates the influence that observations/groups have on the fitted values (leverage). For mixed/hierarchical models leverage can be decomposed into two parts: the fixed part and the random part. We refer the user to the references cited in the help documentation for additional explanation.

Influence on fixed effects estimates

HLMdiag provides cooks.distance and mdffits to assess the influence of subsets of observations on the fixed effects.

Influence on precision of fixed effects

HLMdiag provides covratio and covtrace to assess the influence of subsets of observations on the precision of the fixed effects.

Influence on variance components

HLMdiag's rvc calculates the relative variance change to assess the influence of subsets of observations on the variance components.

Graphics

HLMdiag also strives to make graphical assessment easier in the ggplot2 framework by providing dotplots for influence diagnostics (dotplot_diag), grouped Q-Q plots (group_qqnorm), and Q-Q plots that combine the functionality of qqnorm and qqline (ggplot_qqnorm).

Results