/** HSB dataset example **/ use http://www.stata-press.com/data/mlmus2/hsb.dta, clear xtsum mathach ses sector, i(schoolid) use http://www.stata-press.com/data/mlmus2/smoking.dta, clear /* fit the null model */ xtreg birwt, i(momid) mle /** FROM THE 10-11am WORKSHOP **/ use "studentparentsschool1 6 06 2009.dta", clear keep subnatio-country seorfiscocat1-seorfiscocat192 sample 10 recode seorfiscocat* (0=.) reshape long seorfiscocat, i(subnatio schoolid stidstd cnt country) j(fatherocc) drop if seorfiscocat==.