------------------------------------------------------------------------------- name: log: Q:\C-modelling\runmlwin\website\logfiles\2020-03-27\16\3.5.smcl log type: smcl opened on: 27 Mar 2020, 18:21:24 . **************************************************************************** . * Module 3: Multiple Regression Stata Practicals . * . * P3.5: Checking Model Assumptions in Multiple Regression . * . * 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/3.5.dta", clear . . runmlwin score cons cohort90 sclass1 sclass2 sclass4 female /// > cohort90Xfemale cohort90Xsclass1 cohort90Xsclass2 cohort90Xsclass4, / > // > level1(caseid: cons, residuals(estd, standardised)) /// > mlwinsettings(optimat) nopause MLwiN 3.05 multilevel model Number of obs = 33988 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 1.10 Number of iterations = 2 Log likelihood = -139166.25 Deviance = 278332.5 ------------------------------------------------------------------------------ score | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | 23.806 .172611 137.92 0.000 23.46769 24.14431 cohort90 | 1.297353 .0329408 39.38 0.000 1.23279 1.361916 sclass1 | 13.27072 .2052898 64.64 0.000 12.86836 13.67308 sclass2 | 6.899982 .208843 33.04 0.000 6.490657 7.309307 sclass4 | -4.349855 .2938594 -14.80 0.000 -4.925809 -3.773901 female | 1.975961 .1580878 12.50 0.000 1.666115 2.285808 cohort90Xf~e | .1328717 .0295069 4.50 0.000 .0750392 .1907041 cohort90Xs~1 | -.3174493 .0385311 -8.24 0.000 -.392969 -.2419297 cohort90Xs~2 | -.241989 .0397581 -6.09 0.000 -.3199134 -.1640645 cohort90Xs~4 | .1846463 .0533755 3.46 0.001 .0800323 .2892603 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: caseid | var(cons) | 210.8745 1.617619 207.704 214.045 ------------------------------------------------------------------------------ . . egen estd0rank = rank(estd0) . . generate estd0uniform = estd0rank/(_N + 1) . . generate estd0nscore = invnorm(estd0uniform) . . . . * P3.5.1 Checking the normality assumption . . scatter estd0 estd0nscore . . . . * P3.5.2 Checking the homoskedasticity assumption . . predict predscore . . scatter estd0 predscore . end of do-file