Multilevel Analysis/Hierarchical Linear Modeling
Edpsych/Psych/Stat 587
C.J. Anderson
Spring 2023
This course will be taught Spring 2024 by Professor Jinming Zhang of the Department of Educational Psychology.
Report problems with the web-site or questions about the course contact cja@illinois.edu or jmzhang@illinois.edu
General InformationAnnouncements Course Resources Lecture notes Computer Lab Homework Examples of Papers that Use Multilevel Models (and some others) Example analyses (SAS for text book examples) Handy program and links
General Information :
- Syllabus 2023 (up-dated Jan 18th)
- One thing you should always do when you buy a textbook is to check
the text's web-site. There is a wealth of useful information as well as
a list of corrections here.
Announcements :
- June 29: Links to homework assignments, answer keys, as associated R scripts have been unlinked
Computing Resources
- SAS:
- You can obtain a free educational versions from SAS.com. Look for "SAS Software for Learning". There is a University Edition and an OnDemand version. The latter requires an internet connection but it also includes more procedures (e.g.,
GRAPH, ETS and OR). Alternatively, you can obtain a license from web-store. You can either borrow, download or purchase the program (media) from webstore. With the 2nd option (i.e., purchase), you get more procedures and packages.
- Introduction to SAS
- Resources for R users: :
- Draft chapters on GLM, GLMM, and LLM (i.e., HLM). This link has been disabled for now but I will make some changes and re-post (8/23/2023).
Lecture Notes :
Jumps to specific lectures and associated code:
- Introduction
- Models for clustered data: Fixed and random effects ANOVA and multiple regression.
- Random Intercept Models.
- SAS
- ANCOVA.sas. Fits ANCOVA model to NELS88, N=10 data (includes centering a variable, model fitting using GLM, and SAS/GRAPH of model).
- hsb1.sas. Creates SAS data set of level 1 data for the High School and Beyond data.
- hsb2.sas. Creates SAS data set of level 2 data for the High School and Beyond data.
- hsball.sas. Merges level 1 and level 2 high school and beyond sas datasets.
- betwithin.sas. SAS/GRAPHS for looking between and within variability of SES in the high school and beyond data.
- randomintercepts.sas. SAS PROC MIXED and fitting random intercept models (includes centering SES)...and some graphics.
- R:
- SAS and R for HLM
- Random Intercept and Slopes Models.
- SAS
- text file of data. NELS88 data for N=23 school.
- school23.sas. SAS program that creates SAS data set for NEL88 data for N=23 school.
- NELS23.sas. SAS program that fits various random intercept and slope models to the NEL88 data for N=23 school.
- Centering & NELS data. Illustrates effects of different kinds of centering -- NEL88 data for N=23 school.
- R
- Estimation of Marginal Model.
- SAS:
- R
- R code for graphs illustrating MLE
- Simulating HLM data:
- Bayesian Estimation: The brms package is to fit multilevel model (i.e., Bayesian estimation). This example uses the nels23 data. The specification of the model is very similar to lmer. You need
to build the stan program and install the rstan and the brms package. Check internet of instructions.
- Nels with N=23 schools.
- brms.html
- brms.rmd
- brms.r
- Some references for Bayesian analysis that are all available as from UIUC library:
- Kruschike, J (2014). Doing Bayesian Data Analysis: A Tutorial with R, JAGS and Stan, 2rd Edition.
- Gelman, Carlin, Stern, Dunson, Vehtari, & Rubin (2013). Bayesian Data Analysis. Chapman & Hall/CRC
- Huang, M., & Anderson, C.J. (2020). A Bayesian Solution to Non-convergence of crossed random effects models. In Wiberg, Marie. et al.
Quantitative Psychology 84th annual meeting of the Psychometric Society. Springer International Publishing : Imprint: Springer
; 2020.
- Statistical Inference: Marginal Model.
- Random Effects.
- Power and sample size:
- Xiaofeng Steven Liu (2014). Statistical Power Analysis for the Social and Behavioral Sciences: Basic and Advanced Techniques. Routledge: NY. This book contains explanation of procedures and code for R, SAS and SPSS.
If you search google scholar
- Optimal Design Software Program and documentation from Raudenbush group. (PC only)
- PINT Program and documentation from Snijders. (PC only)
- Google "Xiaofeng Liu power hlm", you will find some of his papers on power and HLM (I think he was a student of Raudenbush).
- SAS:
- R:
- hsball.txt (needed for inference for random effects)
- Inference for Random Effects: html | Rmd | R
- Function and Example for Simulation study: html | Rmd | R
- Model Building.
- SAS:
- NELS:
- Goes with (most of) the lecture notes
- Location scale models
- HSB: Location scale Models including random intercepts and slops and covariance between level 1 and 2 random effect. This uses PROC NLMIXED.
- R:
- This reproduces most of what's in the notes: NELS example html | Rmd
- school23_data.txt
- Location scale models. Should download the paper and program (mixreglsb.exe) from web-site https://www.jstatsoft.org/article/view/v052i12 .
The paper is Hedeker, D, & Norgren, R (2013). A program for mixed-effects location scale analysis. Journal of Statistical Software, 52(12)
- R_mixregls.R This is a function that I wrote that sets up the data and calls the executable program mixreglsb.exe.
- NELS
- HSB
- Longitudinal .