R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ############################################################################ > # MLwiN User Manual > # > # 2 Introduction to Multilevel Modelling . . . . . . . . . . . . . . . . 9 > # > # Rasbash, J., Steele, F., Browne, W. J. and Goldstein, H. (2012). > # A User's Guide to MLwiN, v2.26. Centre for Multilevel Modelling, > # University of Bristol. > ############################################################################ > # R script to replicate all analyses using R2MLwiN > # > # Zhang, Z., Charlton, C., Parker, R, Leckie, G., and Browne, W.J. > # Centre for Multilevel Modelling, 2012 > # http://www.bristol.ac.uk/cmm/software/R2MLwiN/ > ############################################################################ > > library(R2MLwiN) R2MLwiN: A package to run models implemented in MLwiN from R Copyright 2013-2024 Zhengzheng Zhang, Christopher M. J. Charlton, Richard M. A. Parker, William J. Browne and George Leckie Support provided by the Economic and Social Research Council (ESRC) (Grants RES-149-25-1084, RES-576-25-0032 and ES/K007246/1) To cite R2MLwiN in publications use: Zhengzheng Zhang, Richard M. A. Parker, Christopher M. J. Charlton, George Leckie, William J. Browne (2016). R2MLwiN: A Package to Run MLwiN from within R. Journal of Statistical Software, 72(10), 1-43. doi:10.18637/jss.v072.i10 A BibTeX entry for LaTeX users is @Article{, title = {{R2MLwiN}: A Package to Run {MLwiN} from within {R}}, author = {Zhengzheng Zhang and Richard M. A. Parker and Christopher M. J. Charlton and George Leckie and William J. Browne}, journal = {Journal of Statistical Software}, year = {2016}, volume = {72}, number = {10}, pages = {1--43}, doi = {10.18637/jss.v072.i10}, } The MLwiN_path option is currently set to C:/Program Files/MLwiN v3.11/ To change this use: options(MLwiN_path="") > # MLwiN folder > mlwin <- getOption("MLwiN_path") > while (!file.access(mlwin, mode = 1) == 0) { + cat("Please specify the root MLwiN folder or the full path to the MLwiN executable:\n") + mlwin <- scan(what = character(0), sep = "\n") + mlwin <- gsub("\\", "/", mlwin, fixed = TRUE) + } > options(MLwiN_path = mlwin) > > > # 2.1 The tutorial data set . . . . . . . . . . . . . . . . . . . . . . . .9 > > # 2.2 Opening the worksheet and looking at the data . . . . . . . . . . . 10 > > data(tutorial, package = "R2MLwiN") > > summary(tutorial) school student normexam cons 14 : 198 1 : 65 Min. :-3.666072 Min. :1 17 : 126 2 : 65 1st Qu.:-0.699505 1st Qu.:1 18 : 120 3 : 64 Median : 0.004322 Median :1 49 : 113 4 : 64 Mean :-0.000114 Mean :1 8 : 102 5 : 64 3rd Qu.: 0.678759 3rd Qu.:1 15 : 91 6 : 64 Max. : 3.666091 Max. :1 (Other):3309 (Other):3673 standlrt sex schgend avslrt schav Min. :-2.93495 boy :1623 mixedsch:2169 Min. :-0.75596 low : 640 1st Qu.:-0.62071 girl:2436 boysch : 513 1st Qu.:-0.14934 mid :2263 Median : 0.04050 girlsch :1377 Median :-0.02020 high:1156 Mean : 0.00181 Mean : 0.00181 3rd Qu.: 0.61906 3rd Qu.: 0.21052 Max. : 3.01595 Max. : 0.63766 vrband vb1:1176 vb2:2344 vb3: 539 > > head(tutorial) school student normexam cons standlrt sex schgend avslrt schav 1 1 1 0.2613245 1 0.6190593 girl mixedsch 0.1661745 mid 2 1 2 0.1340668 1 0.2058020 girl mixedsch 0.1661745 mid 3 1 3 -1.7238824 1 -1.3645757 boy mixedsch 0.1661745 mid 4 1 4 0.9675860 1 0.2058020 girl mixedsch 0.1661745 mid 5 1 5 0.5443409 1 0.3711049 girl mixedsch 0.1661745 mid 6 1 6 1.7348992 1 2.1894369 boy mixedsch 0.1661745 mid vrband 1 vb1 2 vb2 3 vb3 4 vb2 5 vb2 6 vb1 > > > > # 2.3 Comparing two groups . . . . . . . . . . . . . . . . . . . . . . . .13 > > tab <- cbind(tapply(tutorial$normexam, tutorial$sex, length), tapply(tutorial$normexam, tutorial$sex, mean), tapply(tutorial$normexam, + tutorial$sex, sd)) > tab <- rbind(tab, c(length(tutorial$normexam), mean(tutorial$normexam), sd(tutorial$normexam))) > colnames(tab) <- c("N", "Mean", "SD") > rownames(tab)[3] <- "Total" > > tab N Mean SD boy 1623 -0.1403503443 1.0257126 girl 2436 0.0933194718 0.9697191 Total 4059 -0.0001139137 0.9989439 > > t.test(normexam ~ sex, data = tutorial, var.equal = TRUE) Two Sample t-test data: normexam by sex t = -7.348, df = 4057, p-value = 2.42e-13 alternative hypothesis: true difference in means between group boy and group girl is not equal to 0 95 percent confidence interval: -0.2960165 -0.1713232 sample estimates: mean in group boy mean in group girl -0.14035034 0.09331947 > > (mymodel1 <- runMLwiN(normexam ~ 1 + sex + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Normal) Estimation algorithm: IGLS Elapsed time : 1.82s Number of obs: 4059 (from total 4059) The model converged after 3 iterations. Log likelihood: -5727.9 Deviance statistic: 11455.7 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + sex + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept -0.14035 0.02463 -5.70 1.209e-08 *** -0.18862 -0.09208 sexgirl 0.23367 0.03179 7.35 1.985e-13 *** 0.17136 0.29598 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.98454 0.02185 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 2.4 Comparing more than two groups: Fixed effects models . . . . . . . .20 > > mean_normexam <- aggregate(normexam ~ school, mean, data = tutorial)$normexam > > hist(mean_normexam) > > mymodel2 <- runMLwiN(normexam ~ 1 + (1 | student), data = tutorial) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed > > tutorial$school <- relevel(tutorial$school, 65) > > (mymodel3 <- runMLwiN(normexam ~ 1 + school + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Normal) Estimation algorithm: IGLS Elapsed time : 0.28s Number of obs: 4059 (from total 4059) The model converged after 3 iterations. Log likelihood: -5391.5 Deviance statistic: 10782.9 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + school + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept -0.30869 0.10211 -3.02 0.002503 ** -0.50882 -0.10855 school1 0.80990 0.14783 5.48 4.288e-08 *** 0.52015 1.09964 school2 1.09179 0.15998 6.82 8.82e-12 *** 0.77823 1.40534 school3 1.16413 0.16269 7.16 8.34e-13 *** 0.84526 1.48300 school4 0.38232 0.14487 2.64 0.008312 ** 0.09838 0.66625 school5 0.71230 0.18509 3.85 0.000119 *** 0.34952 1.07508 school6 1.25327 0.14441 8.68 4.007e-18 *** 0.97023 1.53630 school7 0.70019 0.14109 4.96 6.951e-07 *** 0.42366 0.97672 school8 0.26049 0.13640 1.91 0.05616 . -0.00684 0.52783 school9 -0.12700 0.18698 -0.68 0.497 -0.49347 0.23948 school10 0.03930 0.16465 0.24 0.8114 -0.28341 0.36201 school11 0.86591 0.15454 5.60 2.103e-08 *** 0.56303 1.16879 school12 0.23621 0.16785 1.41 0.1594 -0.09278 0.56520 school13 0.06294 0.15317 0.41 0.6811 -0.23727 0.36314 school14 0.32426 0.12100 2.68 0.007364 ** 0.08711 0.56140 school15 0.26808 0.13998 1.92 0.05547 . -0.00627 0.54243 school16 0.05457 0.14109 0.39 0.6989 -0.22196 0.33110 school17 0.06326 0.13057 0.48 0.628 -0.19264 0.31917 school18 0.30254 0.13183 2.29 0.02174 * 0.04416 0.56091 school19 0.51497 0.15998 3.22 0.001286 ** 0.20142 0.82853 school20 0.80778 0.17837 4.53 5.935e-06 *** 0.45818 1.15738 school21 0.68901 0.14783 4.66 3.149e-06 *** 0.39927 0.97875 school22 -0.18951 0.14034 -1.35 0.1769 -0.46458 0.08555 school23 -0.42895 0.20055 -2.14 0.03244 * -0.82201 -0.03588 school24 0.32133 0.18158 1.77 0.07679 . -0.03456 0.67722 school25 -0.30442 0.14783 -2.06 0.03947 * -0.59416 -0.01468 school26 -0.08333 0.14680 -0.57 0.5703 -0.37105 0.20438 school27 -0.02021 0.17837 -0.11 0.9098 -0.36981 0.32939 school28 -0.56402 0.15831 -3.56 0.0003669 *** -0.87430 -0.25375 school29 0.37220 0.14487 2.57 0.01019 * 0.08826 0.65613 school30 0.64414 0.17403 3.70 0.0002145 *** 0.30304 0.98524 school31 0.07201 0.16568 0.43 0.6638 -0.25272 0.39674 school32 -0.06264 0.17403 -0.36 0.7189 -0.40375 0.27846 school33 0.38580 0.14581 2.65 0.008147 ** 0.10002 0.67158 school34 -0.06221 0.20618 -0.30 0.7629 -0.46631 0.34190 school35 0.39264 0.17994 2.18 0.02911 * 0.03996 0.74532 school36 0.05948 0.14948 0.40 0.6907 -0.23349 0.35245 school37 -0.35666 0.21987 -1.62 0.1048 -0.78760 0.07428 school38 0.02114 0.16086 0.13 0.8954 -0.29413 0.33641 school39 0.34701 0.16675 2.08 0.03743 * 0.02019 0.67384 school40 0.04901 0.14892 0.33 0.7421 -0.24286 0.34088 school41 0.38161 0.15598 2.45 0.01442 * 0.07589 0.68732 school42 0.33137 0.15751 2.10 0.03539 * 0.02266 0.64008 school43 0.45628 0.15525 2.94 0.003292 ** 0.15200 0.76056 school44 -0.12504 0.19797 -0.63 0.5276 -0.51305 0.26297 school45 0.08318 0.16176 0.51 0.6071 -0.23386 0.40022 school46 -0.14872 0.14310 -1.04 0.2987 -0.42918 0.13175 school47 0.18643 0.14353 1.30 0.194 -0.09488 0.46773 school48 -0.10561 0.65384 -0.16 0.8717 -1.38711 1.17590 school49 0.35558 0.13345 2.66 0.00771 ** 0.09402 0.61714 school50 -0.01309 0.14783 -0.09 0.9294 -0.30284 0.27665 school51 0.03062 0.15751 0.19 0.8459 -0.27809 0.33933 school52 0.84205 0.15525 5.42 5.83e-08 *** 0.53777 1.14633 school53 1.31224 0.14948 8.78 1.652e-18 *** 1.01926 1.60521 school54 -0.32494 0.33867 -0.96 0.3373 -0.98872 0.33884 school55 1.02581 0.16366 6.27 3.654e-10 *** 0.70505 1.34657 school56 0.27441 0.17994 1.52 0.1273 -0.07827 0.62708 school57 0.30977 0.15384 2.01 0.04406 * 0.00824 0.61129 school58 0.59057 0.18158 3.25 0.001144 ** 0.23468 0.94647 school59 -0.74040 0.16785 -4.41 1.029e-05 *** -1.06939 -0.41141 school60 0.50412 0.14441 3.49 0.0004814 *** 0.22108 0.78715 school61 0.25635 0.15317 1.67 0.0942 . -0.04385 0.55656 school62 0.34668 0.14892 2.33 0.01991 * 0.05481 0.63855 school63 1.04437 0.19553 5.34 9.234e-08 *** 0.66113 1.42760 school64 0.65248 0.15673 4.16 3.141e-05 *** 0.34529 0.95967 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.83416 0.01852 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > aov(normexam ~ school, data = tutorial) Call: aov(formula = normexam ~ school, data = tutorial) Terms: school Residuals Sum of Squares 663.580 3385.853 Deg. of Freedom 64 3994 Residual standard error: 0.9207252 Estimated effects may be unbalanced > > if (!require(lmtest)) { + warning("lmtest package required to use lrtest() function") + } else { + lrtest(mymodel2, mymodel3) + } Loading required package: lmtest Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, as.Date.numeric Likelihood ratio test Model 1: normexam ~ 1 + (1 | student) Model 2: normexam ~ 1 + school + (1 | student) #Df LogLik Df Chisq Pr(>Chisq) 1 2 -5754.7 2 66 -5391.5 64 726.44 < 2.2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > (mymodel4 <- runMLwiN(normexam ~ 1 + school + schgend + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Normal) Estimation algorithm: IGLS Elapsed time : 0.31s Number of obs: 4059 (from total 4059) The model converged after 3 iterations. Log likelihood: -5391.5 Deviance statistic: 10782.9 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + school + schgend + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept -0.30869 0.10211 -3.02 0.002503 ** -0.50882 -0.10855 school1 0.80990 0.14783 5.48 4.288e-08 *** 0.52015 1.09964 school2 1.09179 0.15998 6.82 8.82e-12 *** 0.77823 1.40534 school3 1.16413 0.16269 7.16 8.34e-13 *** 0.84526 1.48300 school4 0.38232 0.14487 2.64 0.008312 ** 0.09838 0.66625 school5 0.71230 0.18509 3.85 0.000119 *** 0.34952 1.07508 school6 1.25327 0.14441 8.68 4.007e-18 *** 0.97023 1.53630 school7 0.70019 0.14109 4.96 6.951e-07 *** 0.42366 0.97672 school8 0.26049 0.13640 1.91 0.05616 . -0.00684 0.52783 school9 -0.12700 0.18698 -0.68 0.497 -0.49347 0.23948 school10 0.03930 0.16465 0.24 0.8114 -0.28341 0.36201 school11 0.86591 0.15454 5.60 2.103e-08 *** 0.56303 1.16879 school12 0.23621 0.16785 1.41 0.1594 -0.09278 0.56520 school13 0.06294 0.15317 0.41 0.6811 -0.23727 0.36314 school14 0.32426 0.12100 2.68 0.007364 ** 0.08711 0.56140 school15 0.26808 0.13998 1.92 0.05547 . -0.00627 0.54243 school16 0.05457 0.14109 0.39 0.6989 -0.22196 0.33110 school17 0.06326 0.13057 0.48 0.628 -0.19264 0.31917 school18 0.30254 0.13183 2.29 0.02174 * 0.04416 0.56091 school19 0.51497 0.15998 3.22 0.001286 ** 0.20142 0.82853 school20 0.80778 0.17837 4.53 5.935e-06 *** 0.45818 1.15738 school21 0.68901 0.14783 4.66 3.149e-06 *** 0.39927 0.97875 school22 -0.18951 0.14034 -1.35 0.1769 -0.46458 0.08555 school23 -0.42895 0.20055 -2.14 0.03244 * -0.82201 -0.03588 school24 0.32133 0.18158 1.77 0.07679 . -0.03456 0.67722 school25 -0.30442 0.14783 -2.06 0.03947 * -0.59416 -0.01468 school26 -0.08333 0.14680 -0.57 0.5703 -0.37105 0.20438 school27 -0.02021 0.17837 -0.11 0.9098 -0.36981 0.32939 school28 -0.56402 0.15831 -3.56 0.0003669 *** -0.87430 -0.25375 school29 0.37220 0.14487 2.57 0.01019 * 0.08826 0.65613 school30 0.64414 0.17403 3.70 0.0002145 *** 0.30304 0.98524 school31 0.07201 0.16568 0.43 0.6638 -0.25272 0.39674 school32 -0.06264 0.17403 -0.36 0.7189 -0.40375 0.27846 school33 0.38580 0.14581 2.65 0.008147 ** 0.10002 0.67158 school34 -0.06221 0.20618 -0.30 0.7629 -0.46631 0.34190 school35 0.39264 0.17994 2.18 0.02911 * 0.03996 0.74532 school36 0.05948 0.14948 0.40 0.6907 -0.23349 0.35245 school37 -0.35666 0.21987 -1.62 0.1048 -0.78760 0.07428 school38 0.02114 0.16086 0.13 0.8954 -0.29413 0.33641 school39 0.34701 0.16675 2.08 0.03743 * 0.02019 0.67384 school40 0.04901 0.14892 0.33 0.7421 -0.24286 0.34088 school41 0.38161 0.15598 2.45 0.01442 * 0.07589 0.68732 school42 0.33137 0.15751 2.10 0.03539 * 0.02266 0.64008 school43 0.45628 0.15525 2.94 0.003292 ** 0.15200 0.76056 school44 -0.12504 0.19797 -0.63 0.5276 -0.51305 0.26297 school45 0.08318 0.16176 0.51 0.6071 -0.23386 0.40022 school46 -0.14872 0.14310 -1.04 0.2987 -0.42918 0.13175 school47 0.18643 0.14353 1.30 0.194 -0.09488 0.46773 school48 -0.10561 0.65384 -0.16 0.8717 -1.38711 1.17590 school49 0.35558 0.13345 2.66 0.00771 ** 0.09402 0.61714 school50 -0.01309 0.14783 -0.09 0.9294 -0.30284 0.27665 school51 0.03062 0.15751 0.19 0.8459 -0.27809 0.33933 school52 0.84205 0.15525 5.42 5.83e-08 *** 0.53777 1.14633 school53 1.31224 0.14948 8.78 1.652e-18 *** 1.01926 1.60521 school54 -0.32494 0.33867 -0.96 0.3373 -0.98872 0.33884 school55 1.02581 0.16366 6.27 3.654e-10 *** 0.70505 1.34657 school56 0.27441 0.17994 1.52 0.1273 -0.07827 0.62708 school57 0.30977 0.15384 2.01 0.04406 * 0.00824 0.61129 school58 0.59057 0.18158 3.25 0.001144 ** 0.23468 0.94647 school59 -0.74040 0.16785 -4.41 1.029e-05 *** -1.06939 -0.41141 school60 0.50412 0.14441 3.49 0.0004814 *** 0.22108 0.78715 school61 0.25635 0.15317 1.67 0.0942 . -0.04385 0.55656 school62 0.34668 0.14892 2.33 0.01991 * 0.05481 0.63855 school63 1.04437 0.19553 5.34 9.234e-08 *** 0.66113 1.42760 school64 0.65248 0.15673 4.16 3.141e-05 *** 0.34529 0.95967 schgendboysch 0.00000 0.00000 NaN NaN N/A 0.00000 0.00000 schgendgirlsch 0.00000 0.00000 NaN NaN N/A 0.00000 0.00000 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.83416 0.01852 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > > # 2.5 Comparing means: Random effects or multilevel model . . . . . . . .28 > > tutorial$school <- as.numeric(levels(tutorial$school))[tutorial$school] > > (mymodel5 <- runMLwiN(normexam ~ 1 + (1 | school) + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: IGLS Elapsed time : 0.08s Number of obs: 4059 (from total 4059) The model converged after 3 iterations. Log likelihood: -5505.3 Deviance statistic: 11010.6 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept -0.01317 0.05363 -0.25 0.806 -0.11827 0.09194 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. var_Intercept 0.16863 0.03245 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.84776 0.01897 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > (mymodel6 <- runMLwiN(normexam ~ 1 + schgend + (1 | school) + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 NEXT iteration 2 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: IGLS Elapsed time : 0.1s Number of obs: 4059 (from total 4059) The model converged after 3 iterations. Log likelihood: -5503 Deviance statistic: 11005.9 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + schgend + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept -0.10140 0.07020 -1.44 0.1486 -0.23900 0.03620 schgendboysch 0.06435 0.14941 0.43 0.6667 -0.22847 0.35718 schgendgirlsch 0.25760 0.11682 2.21 0.02744 * 0.02865 0.48655 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. var_Intercept 0.15513 0.03005 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.84779 0.01897 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . 35 > > > ############################################################################ > > proc.time() user system elapsed 4.21 0.82 12.46