Chapter 3: Two-level Models for Clustered Data

Note: If given the option, right-click on the files, and choose "Save Link/Target As".

Data Sets
The Rat Pup Data
Level 1 SPSS Data Set for HLM
Level 2 SPSS Data Set for HLM
MDM Data File for HLM

Syntax for Mixed Model Analyses
SAS Syntax (includes syntax for descriptives and diagnostics)
SPSS Syntax (Version 28)
R Syntax: lme()
R Syntax: lmer()
Stata .do file (Version 17)

Syntax for Descriptive Statistics
SPSS Syntax for Descriptive Statistics
R Syntax for Descriptive Statistics
Stata Do-file for Descriptive Statistics
HLM Steps for obtaining Descriptive Statistics

Syntax for Final Model Diagnostics
SPSS Syntax for Final Model Diagnostics
R Syntax for Final Model Diagnostics
Stata Do-File for Final Model Diagnostics
Chapter 4 in the book describes how residual files can be saved and processed using the HLM software.

Additional Files
1. Alternative R syntax (and output) for the Chapter 3 analyses, with some useful alternative visualization tools in R. Many thanks to Dr. Jim Robison-Cox at Montana State University!

Last updated 11/2/21.