Specifically, I'm fitting a model similar to this one:
Code: Select all
use "http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial.dta", clear
* Generate a boys' school dummy variable
generate boysch = (schgend==2)
* Generate a girls' school dummy variable
generate girlsch = (schgend==3)
* Fit a two-level random slope model for student age 16 scores and retrieve
* the empirical Bayes estimates of the school random effects
runmlwin normexam cons standlrt girl boysch girlsch, ///
level2(school: cons standlrt, residuals(u)) ///
level1(student: cons) nopause nogroup ///
mlwinpath(C:\Program Files\MLwiN v2.28\i386\MLwiN.exe)
Code: Select all
// Create caterpillar plot of u1 residual
* Tag one observation per school
egen pickone_school = tag(school)
* Rank the standlrt residuals
egen u1rank = rank(u1) if pickone_school
* Plot a caterpillar plot of the standlrt residuals
serrbar u1 u1se u1rank if pickone_school, scale(1.96) yline(0)
Code: Select all
// Create caterpillar plot of sum of standlrt coefficient plus u1 residual
* Sum of standlrt coefficient plus u1 residual
gen standlrt_total = [FP1]standlrt + u1
* Plot sum of standlrt coefficient plus u1 residual
graph dot standlrt_total if pickone_school, over(u1rank) vertical
Thanks for your consideration!
Patrick