Residuals

Residuals with Multilevel Models

(MLM notes). Residuals are often used for model diagnostics or for spotting outliers in the data. For single-level models, these are merely the observed - predicted data (i.e., (y_i - \hat{y}_i)). However, for multilevel models, these are a bit more complicated to compute. Since we have two error terms (in this example), we will have two sets of residuals. For example, a multilevel model with a single predictor at level one can be written as:

Fun with residuals

Random stuff II: Plotting residuals I was poking around my old teaching files and I found an old file and I wasn’t sure what it was: dat <- read.table("https://raw.githubusercontent.com/flh3/pubdata/main/Stefanski_2007/mizzo_1_data_yx1x5.txt") head(dat) ## V1 V2 V3 V4 V5 V6 ## 1 -0.22391 0.0054599 0.380310 0.0135140 0.209240 0.1467100 ## 2 0.84413 0.1073700 -0.026533 0.0458640 0.012987 -0.0271900 ## 3 1.06240 0.0911160 0.181260 0.0501710 -0.188670 -0.0120820 ## 4 -1.04170 0.4404900 0.245960 0.0054154 -0.212920 0.1015200 ## 5 0.