------------------------------------------------------------------------------- name: log: Q:\C-modelling\runmlwin\website\logfiles\2020-03-27\16\5.5.smcl log type: smcl opened on: 27 Mar 2020, 18:21:48 . **************************************************************************** . * Module 5: Introduction to Multilevel Modelling Stata Practicals . * . * P5.5: Complex Level 1 Variation . * . * George Leckie . * Centre for Multilevel Modelling, 2010 . **************************************************************************** . * Stata do-file to replicate all analyses using runmlwin . * . * George Leckie . * Centre for Multilevel Modelling, 2013 . * http://www.bristol.ac.uk/cmm/software/runmlwin/ . **************************************************************************** . . use "http://www.bristol.ac.uk/cmm/media/runmlwin/5.5.dta", clear . . . . * P5.5.2 Within-school variance a function of gender (dichotomous X) . . gen male = 1 - female . . runmlwin score cons cohort90 female sclass1 sclass2 sclass4 /// > schtype schurban cohort90Xschtype, /// > level2(schoolid: cons cohort90) /// > level1(caseid: male female, diagonal) /// > nopause MLwiN 3.05 multilevel model Number of obs = 33988 Normal response model (hierarchical) Estimation algorithm: IGLS ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ schoolid | 508 1 66.9 190 ----------------------------------------------------------- Run time (seconds) = 1.34 Number of iterations = 7 Log likelihood = -138303.77 Deviance = 276607.54 ------------------------------------------------------------------------------ score | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | 25.1951 .431889 58.34 0.000 24.34861 26.04158 cohort90 | 1.215711 .0243581 49.91 0.000 1.16797 1.263452 female | 1.969525 .1544567 12.75 0.000 1.666796 2.272255 sclass1 | 11.01912 .2067111 53.31 0.000 10.61397 11.42427 sclass2 | 5.83534 .2039754 28.61 0.000 5.435556 6.235125 sclass4 | -3.765815 .2843592 -13.24 0.000 -4.323149 -3.208482 schtype | 5.311828 .829912 6.40 0.000 3.68523 6.938425 schurban | -1.413422 .4819941 -2.93 0.003 -2.358114 -.4687312 cohort90Xs~e | -.5928781 .1036467 -5.72 0.000 -.7960219 -.3897343 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: schoolid | var(cons) | 20.37349 1.572667 17.29112 23.45586 cov(cons,cohort90) | -.4010763 .114824 -.6261273 -.1760253 var(cohort90) | .1370188 .0161888 .1052893 .1687483 -----------------------------+------------------------------------------------ Level 1: caseid | var(female) | 186.8748 2.005443 182.9442 190.8054 var(male) | 199.5683 2.262202 195.1345 204.0022 ------------------------------------------------------------------------------ . end of do-file