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 MCMC Manual > # > # 18 Multivariate Normal Response Models and Missing Data . . . . . . . 263 > # > # Browne, W.J. (2009) MCMC Estimation in MLwiN, v2.13. 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/ > ############################################################################ > > # 18.1 GCSE science data with complete records only . . . . . . . . . . .264 > > 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) > > # User's input if necessary > > ## save current par settings > mypar <- par(no.readonly = TRUE) > > ## Read gcsecomp1 data > data(gcsecomp1, package="R2MLwiN") > #summary(gcsecomp1) > #cor(gcsecomp1[, c("written", "csework")]) > > # 18.2 Fitting single level multivariate models . . . . . . . . . . . . .265 > > ## IGLS > (mymodel <- runMLwiN(c(written, csework) ~ 1 + (1 | student), D = "Multivariate Normal", estoptions = list(sort.ignore = TRUE), + data = gcsecomp1)) /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 (Multivariate Normal) Estimation algorithm: IGLS Elapsed time : 0.22s Number of obs: 1523 (from total 1523) The model converged after 3 iterations. Log likelihood: -12353.1 Deviance statistic: 24706.2 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept_written 46.93697 0.34562 135.81 0 *** 46.25957 47.61436 Intercept_csework 73.42902 0.42103 174.40 0 *** 72.60382 74.25423 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_written 181.92302 6.59254 cov_Intercept_written_Intercept_csework 105.24772 6.28664 var_Intercept_csework 269.97548 9.78339 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > ## MCMC > (mymodel <- runMLwiN(c(written, csework) ~ 1 + (1 | student), D = "Multivariate Normal", estoptions = list(EstM = 1, + sort.ignore = TRUE), data = gcsecomp1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 24712.761985 Burning in for 100 iterations out of 500 -2 * Loglike = 24712.827164 Burning in for 150 iterations out of 500 -2 * Loglike = 24712.671515 Burning in for 200 iterations out of 500 -2 * Loglike = 24709.265760 Burning in for 250 iterations out of 500 -2 * Loglike = 24709.748955 Burning in for 300 iterations out of 500 -2 * Loglike = 24710.119439 Burning in for 350 iterations out of 500 -2 * Loglike = 24711.763175 Burning in for 400 iterations out of 500 -2 * Loglike = 24711.993138 Burning in for 450 iterations out of 500 -2 * Loglike = 24706.675306 Burning in for 500 iterations out of 500 -2 * Loglike = 24710.497285 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 24707.809513 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 24717.455478 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 24709.513195 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 24712.212243 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 24709.963049 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 24708.839905 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 24711.836897 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 24711.187807 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 24709.226189 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 24713.232644 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 24714.150482 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 24711.239913 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 24711.314472 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 24715.376057 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 24715.830198 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 24711.581041 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 24708.425901 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 24712.986972 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 24710.603097 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 24714.875142 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 24718.154447 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 24708.851824 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 24709.998113 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 24709.890677 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 24709.290240 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 24710.014311 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 24716.359053 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 24709.594216 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 24709.429607 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 24715.675608 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 24707.877547 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 24710.146010 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 24713.615539 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 24711.108046 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 24707.245765 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 24711.436871 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 24709.285462 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 24713.312946 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 24708.781266 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 24710.555260 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 24709.476788 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 24709.012963 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 24708.637155 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 24708.548953 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 24708.778156 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 24708.613055 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 24712.910409 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 24711.003002 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 24710.865027 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 24710.067783 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 24708.064205 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 24707.378257 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 24715.167761 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 24707.792922 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 24709.613793 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 24711.950398 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 24711.950282 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 24710.339213 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 24712.922690 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 24711.767735 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 24710.906025 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 24709.669485 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 24713.946617 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 24710.685598 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 24710.054704 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 24709.640552 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 24712.628840 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 24711.267711 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 24709.630018 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 24709.269270 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 24715.381989 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 24708.253988 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 24710.335133 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 24721.629185 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 24711.284693 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 24708.563135 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 24708.332028 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 24711.581025 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 24710.818068 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 24709.237578 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 24707.074358 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 24708.132829 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 24711.192085 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 24728.206116 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 24714.359835 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 24710.067637 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 24714.106760 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 24715.710641 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 24709.429303 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 24709.675076 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 24709.283530 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 24716.419686 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 24716.625441 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 24711.394211 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 24706.896912 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 24708.061037 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 24712.204192 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 24708.730451 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 24707.247809 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 24707.610605 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 24711. S.D. = 3.1683 S.E.M. = 0.044807 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 1.14s Number of obs: 1523 (from total 1523) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 24711.202 24706.245 4.957 24716.158 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_written 46.92953 0.34896 134.48 0 *** 46.26110 47.61791 5000 Intercept_csework 73.42916 0.41586 176.57 0 *** 72.60318 74.23375 5000 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 182.44520 6.59064 170.13300 196.04102 5000 cov_Intercept_written_Intercept_csework 105.47374 6.26473 93.45724 117.64518 5278 var_Intercept_csework 270.21418 9.65917 251.47894 289.30814 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 18.3 Adding predictor variables . . . . . . . . . . . . . . . . . . . .270 > > (mymodel <- runMLwiN(c(written, csework) ~ 1 + female + (1 | student), D = "Multivariate Normal", estoptions = list(EstM = 1, + sort.ignore = TRUE), data = gcsecomp1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 24567.718516 Burning in for 100 iterations out of 500 -2 * Loglike = 24567.044053 Burning in for 150 iterations out of 500 -2 * Loglike = 24572.018209 Burning in for 200 iterations out of 500 -2 * Loglike = 24564.612996 Burning in for 250 iterations out of 500 -2 * Loglike = 24566.572697 Burning in for 300 iterations out of 500 -2 * Loglike = 24563.269828 Burning in for 350 iterations out of 500 -2 * Loglike = 24561.849404 Burning in for 400 iterations out of 500 -2 * Loglike = 24562.399770 Burning in for 450 iterations out of 500 -2 * Loglike = 24571.921662 Burning in for 500 iterations out of 500 -2 * Loglike = 24571.889147 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 24563.639862 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 24564.374208 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 24568.079593 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 24563.249613 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 24564.299400 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 24563.246678 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 24563.829818 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 24569.946387 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 24566.209490 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 24566.371750 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 24565.274432 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 24569.721035 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 24567.406906 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 24563.756311 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 24562.740911 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 24564.127781 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 24569.455000 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 24560.558159 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 24567.626609 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 24568.108588 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 24562.300074 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 24568.925395 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 24564.026046 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 24565.989649 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 24562.768297 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 24567.785033 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 24569.532197 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 24564.320173 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 24564.317295 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 24561.677646 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 24569.210464 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 24567.273821 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 24563.721033 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 24569.952308 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 24569.099030 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 24564.472717 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 24563.301852 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 24566.406571 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 24564.920745 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 24566.232300 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 24562.096518 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 24564.366065 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 24564.156437 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 24565.481484 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 24564.533049 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 24561.928832 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 24562.711126 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 24565.340244 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 24565.963406 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 24566.222920 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 24565.804732 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 24563.319451 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 24563.756772 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 24562.557246 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 24568.136169 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 24564.962147 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 24568.563324 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 24561.163991 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 24565.268014 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 24575.976705 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 24571.854292 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 24566.020762 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 24567.582409 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 24561.850883 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 24566.635762 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 24570.644876 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 24568.723586 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 24566.145837 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 24570.375138 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 24567.549690 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 24562.848593 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 24564.419799 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 24566.813369 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 24565.150057 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 24562.026227 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 24571.480125 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 24573.572676 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 24562.433764 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 24565.533476 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 24564.516111 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 24562.370642 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 24568.341832 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 24562.357679 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 24575.248570 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 24567.846368 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 24562.757090 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 24562.805978 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 24562.780030 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 24566.984018 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 24571.960099 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 24574.076517 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 24566.980416 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 24564.366075 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 24564.402447 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 24568.383303 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 24562.536955 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 24565.067532 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 24560.852872 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 24571.760841 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 24563.639889 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 24566. S.D. = 3.6787 S.E.M. = 0.052025 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 1.41s Number of obs: 1523 (from total 1523) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 24566.152 24559.198 6.954 24573.106 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + female + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_written 48.90698 0.53407 91.57 0 *** 47.87437 49.94766 5741 Intercept_csework 69.73940 0.64125 108.76 0 *** 68.50809 70.99194 5000 femaleFemale_written -3.34052 0.70156 -4.76 1.921e-06 *** -4.72219 -1.98013 5666 femaleFemale_csework 6.24260 0.83582 7.47 8.091e-14 *** 4.59801 7.87595 4816 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 179.68640 6.54424 167.52565 193.23839 5000 cov_Intercept_written_Intercept_csework 110.43491 6.28969 98.51269 123.09717 4599 var_Intercept_csework 261.12368 9.38071 243.69445 280.43664 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 18.4 A multilevel multivariate model . . . . . . . . . . . . . . . . . 271 > > ## Store residual chain at level 3: school > (mymodel <- runMLwiN(c(written, csework) ~ 1 + female + (1 | school) + (1 | student), D = "Multivariate Normal", estoptions = list(EstM = 1, + resi.store = TRUE, resi.store.levs = 2), data = gcsecomp1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 23518.337586 Burning in for 100 iterations out of 500 -2 * Loglike = 23496.241373 Burning in for 150 iterations out of 500 -2 * Loglike = 23513.367385 Burning in for 200 iterations out of 500 -2 * Loglike = 23533.389402 Burning in for 250 iterations out of 500 -2 * Loglike = 23500.685817 Burning in for 300 iterations out of 500 -2 * Loglike = 23535.204223 Burning in for 350 iterations out of 500 -2 * Loglike = 23506.949106 Burning in for 400 iterations out of 500 -2 * Loglike = 23520.497657 Burning in for 450 iterations out of 500 -2 * Loglike = 23553.905757 Burning in for 500 iterations out of 500 -2 * Loglike = 23561.382655 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 23505.451151 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 23533.361167 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 23506.752113 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 23496.287789 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 23516.355384 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 23542.111221 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 23541.522919 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 23539.577406 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 23497.026888 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 23495.372466 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 23539.841345 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 23507.388188 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 23511.025564 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 23515.855340 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 23528.664114 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 23524.520823 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 23523.762951 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 23520.539463 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 23576.192515 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 23525.751990 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 23499.862270 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 23533.618153 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 23536.740711 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 23514.774131 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 23529.166032 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 23515.808994 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 23497.096845 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 23520.124464 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 23506.975254 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 23528.543006 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 23517.035589 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 23542.193505 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 23541.074706 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 23530.885361 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 23500.235021 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 23489.553884 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 23518.667296 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 23521.940540 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 23488.334541 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 23562.747754 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 23528.092866 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 23524.281781 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 23531.623994 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 23542.006286 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 23536.343108 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 23495.154639 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 23500.084408 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 23540.274635 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 23535.588117 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 23508.422165 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 23511.708448 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 23540.072440 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 23500.518295 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 23516.737130 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 23523.847848 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 23533.207426 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 23523.429432 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 23551.127811 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 23510.547879 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 23536.424121 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 23515.489007 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 23503.295158 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 23509.339972 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 23546.523026 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 23525.932989 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 23530.786550 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 23488.185378 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 23507.947982 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 23523.036447 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 23547.058328 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 23531.076926 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 23558.214406 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 23505.136395 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 23504.408086 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 23538.868172 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 23540.344831 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 23519.686898 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 23525.913154 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 23528.771896 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 23511.224909 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 23525.862715 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 23500.362015 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 23516.496746 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 23528.687410 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 23558.412239 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 23526.595460 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 23529.425916 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 23527.276192 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 23556.678637 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 23516.820517 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 23532.439152 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 23513.799531 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 23554.118843 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 23511.771512 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 23533.574337 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 23519.890844 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 23493.642392 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 23512.679313 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 23523.420512 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 23529.820759 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 23525. S.D. = 17.633 S.E.M. = 0.24937 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) N min mean max N_complete min_complete mean_complete max_complete school 73 1 20.86301 83 73 1 20.86301 83 Estimation algorithm: MCMC Elapsed time : 3s Number of obs: 1523 (from total 1523) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 23524.533 23397.731 126.802 23651.335 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + female + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_written 49.54661 0.98736 50.18 0 *** 47.53544 51.38876 276 Intercept_csework 69.74137 1.23505 56.47 0 *** 67.24932 72.07970 251 femaleFemale_written -2.44703 0.60321 -4.06 4.978e-05 *** -3.66714 -1.23090 4488 femaleFemale_csework 6.98832 0.71803 9.73 2.189e-22 *** 5.57811 8.39508 4468 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 52.26476 10.73447 34.59787 76.02030 2444 cov_Intercept_written_Intercept_csework 29.43397 10.26216 11.68536 51.95842 2464 var_Intercept_csework 79.63063 15.78965 54.41638 115.11535 2762 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 125.30743 4.65047 116.22411 134.48569 4396 cov_Intercept_written_Intercept_csework 74.28499 4.45052 65.82727 83.28159 4382 var_Intercept_csework 184.06718 6.85074 170.79610 198.28880 4610 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > resi <- mymodel@resi.chains$resi_lev2 > label <- 1:ncol(resi) > > ## highlight > hipos <- rep(0, 6) > hipos[1] <- which(levels(as.factor(gcsecomp1$school)) == 68137) > hipos[2] <- which(levels(as.factor(gcsecomp1$school)) == 68201) > hipos[3] <- which(levels(as.factor(gcsecomp1$school)) == 68711) > hipos[4] <- which(levels(as.factor(gcsecomp1$school)) == 60427) > hipos[5] <- which(levels(as.factor(gcsecomp1$school)) == 22710) > hipos[6] <- which(levels(as.factor(gcsecomp1$school)) == 67105) > > par(mfrow = c(2, 1)) > ## Select u0 > resi0 <- resi[, label[which(label%%2 == 1)]] > resi0mean <- apply(resi0, 2, mean) > resi0sd <- apply(resi0, 2, sd) > rankno0 <- order(resi0mean) > resi0.lo <- resi0mean - 1.4 * resi0sd > resi0.hi <- resi0mean + 1.4 * resi0sd > caterpillar(y = resi0mean[rankno0], x = 1:length(resi0mean), qtlow = resi0.lo[rankno0], qtup = resi0.hi[rankno0], + ylim = c(-24, 21), ylab = "cons.written", xlab = "rank") > abline(h = 0, lty = "dotted") > for (i in 1:6) points(x = which(rankno0 == hipos[i]), y = resi0mean[rankno0[which(rankno0 == hipos[i])]], pch = 22, + bg = i + 1) > > ## Select u1 > resi1 <- resi[, label[which(label%%2 == 0)]] > resi1mean <- apply(resi1, 2, mean) > resi1sd <- apply(resi1, 2, sd) > rankno1 <- order(resi1mean) > resi1.lo <- resi1mean - 1.4 * resi1sd > resi1.hi <- resi1mean + 1.4 * resi1sd > caterpillar(y = resi1mean[rankno1], x = 1:length(resi1mean), qtlow = resi1.lo[rankno1], qtup = resi1.hi[rankno1], + ylim = c(-24, 21), ylab = "cons.csework", xlab = "rank") > abline(h = 0, lty = "dotted") > for (i in 1:6) points(x = which(rankno1 == hipos[i]), y = resi1mean[rankno1[which(rankno1 == hipos[i])]], pch = 22, + bg = i + 1) > > par(mfrow = c(1, 1)) > plot(resi0mean, resi1mean, pch = 24, bg = "black", xlab = "cons.written", ylab = "cons.csework") > for (i in 1:6) points(x = resi0mean[rankno0[which(rankno0 == hipos[i])]], y = resi1mean[rankno1[which(rankno1 == hipos[i])]], + pch = 24, bg = i + 1) > > # 18.5 GCSE science data with missing records . . . . . . . . . . . . . .275 > > ## Read gcsemv1 data > data(gcsemv1, package = "R2MLwiN") > > (mymodel <- runMLwiN(c(written, csework) ~ 1 + female + (1 | student), D = "Multivariate Normal", estoptions = list(EstM = 1, + sort.ignore = TRUE), data = gcsemv1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 30650.473261 Burning in for 100 iterations out of 500 -2 * Loglike = 30678.224828 Burning in for 150 iterations out of 500 -2 * Loglike = 30688.893993 Burning in for 200 iterations out of 500 -2 * Loglike = 30629.119728 Burning in for 250 iterations out of 500 -2 * Loglike = 30672.167054 Burning in for 300 iterations out of 500 -2 * Loglike = 30664.582320 Burning in for 350 iterations out of 500 -2 * Loglike = 30648.834239 Burning in for 400 iterations out of 500 -2 * Loglike = 30635.826439 Burning in for 450 iterations out of 500 -2 * Loglike = 30685.690289 Burning in for 500 iterations out of 500 -2 * Loglike = 30667.689647 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 30646.765233 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 30674.335405 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 30683.828401 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 30721.418470 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 30677.372332 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 30695.636690 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 30721.676946 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 30680.604975 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 30691.810776 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 30653.244011 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 30681.818191 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 30684.552641 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 30685.251660 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 30677.563591 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 30676.683827 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 30675.190371 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 30700.660615 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 30678.117335 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 30662.815336 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 30701.272645 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 30680.303184 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 30659.286515 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 30661.137156 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 30671.704962 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 30677.947274 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 30670.281075 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 30655.760395 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 30669.662076 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 30669.239365 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 30728.360826 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 30728.588734 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 30699.669667 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 30714.569269 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 30648.000459 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 30671.914955 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 30700.076018 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 30680.527511 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 30695.091790 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 30677.178683 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 30682.856575 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 30684.568275 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 30627.483747 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 30698.758249 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 30632.150106 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 30662.254740 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 30749.064118 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 30713.728668 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 30667.354733 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 30636.889802 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 30748.919330 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 30650.142025 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 30681.577165 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 30685.218928 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 30690.988910 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 30688.982363 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 30678.368938 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 30694.225309 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 30616.356085 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 30736.014711 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 30656.828806 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 30677.708688 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 30691.899125 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 30663.636810 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 30672.143090 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 30716.456608 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 30680.227760 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 30696.416920 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 30671.020473 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 30686.819548 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 30635.487121 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 30643.200144 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 30625.264082 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 30721.976553 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 30691.065764 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 30655.038228 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 30662.659161 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 30687.156779 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 30626.185527 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 30693.770783 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 30641.888936 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 30746.279436 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 30679.676974 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 30678.797489 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 30704.906577 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 30677.977882 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 30635.603334 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 30718.035212 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 30699.325768 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 30656.918615 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 30691.333987 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 30677.956397 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 30703.797456 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 30720.342728 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 30693.425487 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 30722.196268 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 30682.447430 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 30602.737628 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 30700.097609 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 30709.236456 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 30649.047208 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 30681. S.D. = 29.909 S.E.M. = 0.42298 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 1.91s Number of obs: 1905 (from total 1905) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 30680.920 30292.135 388.785 31069.705 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + female + (1 | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_written 48.80161 0.49806 97.98 0 *** 47.82918 49.78542 4429 Intercept_csework 69.83532 0.61048 114.39 0 *** 68.63363 71.01240 4211 femaleFemale_written -3.42652 0.65213 -5.25 1.485e-07 *** -4.68695 -2.12737 4314 femaleFemale_csework 5.88735 0.79333 7.42 1.162e-13 *** 4.34843 7.42364 4466 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 176.64572 5.87232 165.37299 188.30471 4371 cov_Intercept_written_Intercept_csework 108.02243 5.66291 97.27586 119.30906 4033 var_Intercept_csework 258.07835 8.66452 241.39620 275.09566 4173 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > (mymodel <- runMLwiN(c(written, csework) ~ 1 + female + (1 | school) + (1 | student), D = "Multivariate Normal", estoptions = list(EstM = 1, + mcmcMeth = list(dami = 2)), data = gcsemv1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 29344.281174 Burning in for 100 iterations out of 500 -2 * Loglike = 29366.494377 Burning in for 150 iterations out of 500 -2 * Loglike = 29413.321660 Burning in for 200 iterations out of 500 -2 * Loglike = 29367.829448 Burning in for 250 iterations out of 500 -2 * Loglike = 29411.000546 Burning in for 300 iterations out of 500 -2 * Loglike = 29378.001450 Burning in for 350 iterations out of 500 -2 * Loglike = 29395.171642 Burning in for 400 iterations out of 500 -2 * Loglike = 29380.177822 Burning in for 450 iterations out of 500 -2 * Loglike = 29423.695203 Burning in for 500 iterations out of 500 -2 * Loglike = 29416.136426 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 29440.464074 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 29382.479147 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 29417.987531 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 29438.787231 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 29404.307853 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 29376.739692 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 29373.632375 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 29344.283928 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 29435.696592 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 29363.635290 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 29392.099370 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 29470.452140 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 29351.961052 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 29369.097945 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 29503.943516 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 29351.750135 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 29351.481406 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 29423.189496 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 29394.608243 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 29378.838968 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 29435.913290 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 29431.720691 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 29375.805697 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 29440.092527 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 29433.456945 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 29381.003644 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 29371.167582 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 29338.782511 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 29337.502728 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 29324.386295 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 29388.746006 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 29448.585327 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 29420.532263 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 29379.674029 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 29395.203358 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 29356.619286 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 29321.529115 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 29365.524536 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 29361.350002 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 29393.941322 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 29420.440467 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 29424.625673 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 29381.791621 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 29355.628582 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 29398.251118 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 29319.103551 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 29358.480606 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 29392.597655 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 29418.776871 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 29310.823266 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 29436.073233 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 29420.963872 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 29402.785535 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 29373.615539 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 29340.636021 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 29369.694821 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 29410.910922 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 29406.365410 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 29447.439129 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 29401.949161 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 29425.213466 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 29349.345004 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 29430.062516 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 29398.608834 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 29360.390164 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 29390.529509 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 29406.578385 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 29362.678644 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 29331.190385 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 29357.371720 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 29438.335938 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 29374.507610 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 29363.757250 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 29357.250677 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 29439.942878 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 29394.983895 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 29392.645907 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 29393.618360 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 29444.174352 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 29462.636164 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 29407.667056 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 29359.491920 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 29394.831360 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 29393.973182 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 29355.081174 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 29460.386468 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 29361.586362 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 29411.865114 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 29309.587827 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 29409.961007 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 29379.755173 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 29418.589930 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 29423.454254 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 29408.376016 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 29364.985413 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 29354.395587 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 29417.174804 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 29405.986930 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 29376.049505 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 29329.789163 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 29389. S.D. = 35.415 S.E.M. = 0.50085 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) N min mean max N_complete min_complete mean_complete max_complete school 73 2 26.09589 104 73 2 26.09589 104 Estimation algorithm: MCMC Elapsed time : 3.47s Number of obs: 1905 (from total 1905) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 29388.933 28878.425 510.508 29899.442 --------------------------------------------------------------------------------------------------- The model formula: c(written, csework) ~ 1 + female + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_written 49.36510 0.96196 51.32 0 *** 47.47247 51.24127 255 Intercept_csework 69.64355 1.20394 57.85 0 *** 67.26242 71.90673 235 femaleFemale_written -2.48806 0.55490 -4.48 7.333e-06 *** -3.57422 -1.38915 3656 femaleFemale_csework 6.76583 0.66108 10.23 1.389e-24 *** 5.48019 8.07808 3661 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 49.57074 10.11818 33.01899 73.87114 2716 cov_Intercept_written_Intercept_csework 26.36400 9.61538 9.46633 46.91432 2920 var_Intercept_csework 79.75505 15.78038 53.52328 115.39169 2788 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 125.06278 4.40554 116.77123 134.05452 3648 cov_Intercept_written_Intercept_csework 73.19540 4.19897 65.43246 81.94018 3620 var_Intercept_csework 180.62558 6.33571 168.81559 193.42671 3879 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 18.6 Imputation methods for missing data . . . . . . . . . . . . . . . 280 > > # 18.7 Hungarian science exam dataset . . . . . . . . . . . . . . . . . .281 > > ## Read hungary1 data > data(hungary1, package = "R2MLwiN") > summary(hungary1) school female es_core biol_core Min. : 1018 Male :1196 Min. : 0.000 Min. : 0.000 1st Qu.: 4041 Female:1243 1st Qu.: 8.333 1st Qu.: 6.000 Median : 8085 Median : 8.333 Median : 7.000 Mean : 8188 Mean : 8.394 Mean : 7.066 3rd Qu.:13016 3rd Qu.:10.000 3rd Qu.: 8.000 Max. :14015 Max. :10.000 Max. :10.000 biol_r3 biol_r4 phys_core phys_r2 Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000 1st Qu.: 5.000 1st Qu.: 2.500 1st Qu.: 6.000 1st Qu.: 4.286 Median : 7.500 Median : 5.000 Median : 7.000 Median : 7.143 Mean : 6.882 Mean : 5.713 Mean : 7.212 Mean : 6.298 3rd Qu.: 7.500 3rd Qu.: 7.500 3rd Qu.: 9.000 3rd Qu.: 8.571 Max. :10.000 Max. :10.000 Max. :10.000 Max. :10.000 NA's :1217 NA's :1233 NA's :1213 cons student Min. :1 Min. : 1.0 1st Qu.:1 1st Qu.: 610.5 Median :1 Median :1220.0 Mean :1 Mean :1220.0 3rd Qu.:1 3rd Qu.:1829.5 Max. :1 Max. :2439.0 > > (mymodel <- runMLwiN(c(es_core, biol_core, biol_r3, biol_r4, phys_core, phys_r2) ~ 1 + female + (1 | school) + (1 | student), + D = "Multivariate Normal", data = hungary1)) /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 iteration 3 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) N min mean max N_complete min_complete mean_complete max_complete school 99 12 24.63636 34 99 12 24.63636 34 Estimation algorithm: IGLS Elapsed time : 12.89s Number of obs: 2439 (from total 2439) The model converged after 4 iterations. Log likelihood: -21685.9 Deviance statistic: 43371.7 --------------------------------------------------------------------------------------------------- The model formula: c(es_core, biol_core, biol_r3, biol_r4, phys_core, phys_r2) ~ 1 + female + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept_es_core 8.37975 0.07668 109.29 0 *** 8.22947 8.53003 Intercept_biol_core 7.10640 0.09957 71.37 0 *** 6.91124 7.30156 Intercept_biol_r3 6.84409 0.10909 62.74 0 *** 6.63027 7.05791 Intercept_biol_r4 5.91266 0.16771 35.26 2.859e-272 *** 5.58395 6.24136 Intercept_phys_core 7.52045 0.11505 65.37 0 *** 7.29496 7.74594 Intercept_phys_r2 6.63603 0.12761 52.00 0 *** 6.38591 6.88614 femaleFemale_es_core -0.02987 0.05897 -0.51 0.6125 -0.14544 0.08570 femaleFemale_biol_core -0.15076 0.06632 -2.27 0.02301 * -0.28075 -0.02077 femaleFemale_biol_r3 0.03992 0.12537 0.32 0.7501 -0.20579 0.28564 femaleFemale_biol_r4 -0.49192 0.13762 -3.57 0.0003508 *** -0.76164 -0.22219 femaleFemale_phys_core -0.69561 0.07291 -9.54 1.427e-21 *** -0.83852 -0.55270 femaleFemale_phys_r2 -0.69608 0.11600 -6.00 1.964e-09 *** -0.92343 -0.46873 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_es_core 0.40570 0.06997 cov_Intercept_es_core_Intercept_biol_core 0.37856 0.07732 var_Intercept_biol_core 0.75852 0.12338 cov_Intercept_es_core_Intercept_biol_r3 0.19676 0.06480 cov_Intercept_biol_core_Intercept_biol_r3 0.35819 0.08967 var_Intercept_biol_r3 0.36706 0.10746 cov_Intercept_es_core_Intercept_biol_r4 0.40457 0.11506 cov_Intercept_biol_core_Intercept_biol_r4 0.80206 0.16545 cov_Intercept_biol_r3_Intercept_biol_r4 0.37398 0.13817 var_Intercept_biol_r4 1.83150 0.32650 cov_Intercept_es_core_Intercept_phys_core 0.37396 0.08641 cov_Intercept_biol_core_Intercept_phys_core 0.79618 0.13245 cov_Intercept_biol_r3_Intercept_phys_core 0.46744 0.10631 cov_Intercept_biol_r4_Intercept_phys_core 0.87168 0.18917 var_Intercept_phys_core 1.04069 0.16677 cov_Intercept_es_core_Intercept_phys_r2 0.34370 0.08796 cov_Intercept_biol_core_Intercept_phys_r2 0.65881 0.12743 cov_Intercept_biol_r3_Intercept_phys_r2 0.33522 0.10478 cov_Intercept_biol_r4_Intercept_phys_r2 0.85667 0.19531 cov_Intercept_phys_core_Intercept_phys_r2 0.77685 0.14928 var_Intercept_phys_r2 0.94509 0.18131 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept_es_core 2.05809 0.06017 cov_Intercept_es_core_Intercept_biol_core 0.63471 0.04963 var_Intercept_biol_core 2.60523 0.07616 cov_Intercept_es_core_Intercept_biol_r3 0.38653 0.09161 cov_Intercept_biol_core_Intercept_biol_r3 0.47322 0.10314 var_Intercept_biol_r3 4.78296 0.20134 cov_Intercept_es_core_Intercept_biol_r4 0.47151 0.10011 cov_Intercept_biol_core_Intercept_biol_r4 1.03747 0.11413 cov_Intercept_biol_r3_Intercept_biol_r4 1.04231 0.25892 var_Intercept_biol_r4 5.84651 0.24665 cov_Intercept_es_core_Intercept_phys_core 0.65933 0.05431 cov_Intercept_biol_core_Intercept_phys_core 1.19550 0.06411 cov_Intercept_biol_r3_Intercept_phys_core 0.41427 0.11310 cov_Intercept_biol_r4_Intercept_phys_core 1.16200 0.12545 var_Intercept_phys_core 3.14312 0.09189 cov_Intercept_es_core_Intercept_phys_r2 0.66153 0.08516 cov_Intercept_biol_core_Intercept_phys_r2 1.14354 0.09748 cov_Intercept_biol_r3_Intercept_phys_r2 0.66092 0.21628 cov_Intercept_biol_r4_Intercept_phys_r2 1.91150 0.22907 cov_Intercept_phys_core_Intercept_phys_r2 1.54718 0.10869 var_Intercept_phys_r2 4.48816 0.18553 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > (mymodel <- runMLwiN(c(es_core, biol_core, biol_r3, biol_r4, phys_core, phys_r2) ~ 1 + female + (1 | school) + (1 | student), + D = "Multivariate Normal", estoptions = list(EstM = 1, mcmcMeth = list(dami = c(0, 1000, 2000, 3000, 4000, + 5000))), data = hungary1)) MLwiN is running, please wait...... /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 BATC 1 Batch mode is ON NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 4 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 58684.473701 Burning in for 100 iterations out of 500 -2 * Loglike = 58363.350480 Burning in for 150 iterations out of 500 -2 * Loglike = 58415.308613 Burning in for 200 iterations out of 500 -2 * Loglike = 58331.221797 Burning in for 250 iterations out of 500 -2 * Loglike = 58277.187978 Burning in for 300 iterations out of 500 -2 * Loglike = 58309.827112 Burning in for 350 iterations out of 500 -2 * Loglike = 58457.128628 Burning in for 400 iterations out of 500 -2 * Loglike = 58393.432150 Burning in for 450 iterations out of 500 -2 * Loglike = 58123.572620 Burning in for 500 iterations out of 500 -2 * Loglike = 58256.707760 ERAS G30 LINK 0 G30 ERAS c1090 c1091 LINK 6 G23 MCMC 1 1000 1 c1090 c1091 c1003 c1004 1 4 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 58461.039378 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 58584.843057 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 58266.276103 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 58285.016543 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 58267.327660 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 58446.442591 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 58426.455924 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 58459.974525 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 58438.382271 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 58091.730342 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 58460.923870 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 58540.001815 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 58339.700082 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 58269.709330 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 58540.947149 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 58497.149654 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 58304.720703 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 58563.191835 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 58430.951889 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 58419.883691 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 1000 Average = 58389. S.D. = 133.29 S.E.M. = 4.2149 DAMI 0 G23[1] NAME G23[1] '_est_1000' PAUS 1 PAUSed batch file execution MCMC 1 1000 1 c1090 c1091 c1003 c1004 1 4 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 58301.084132 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 58278.147045 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 58472.199145 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 58234.561850 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 58459.341629 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 58017.692409 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 58242.654135 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 58271.072053 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 58470.058247 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 58063.890491 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 58367.314964 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 58527.810695 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 58570.336618 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 58384.522309 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 58165.507213 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 58270.508084 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 58267.010548 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 58624.500752 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 58361.589395 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 58455.251550 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 2000 Average = 58379. S.D. = 139.56 S.E.M. = 3.1206 DAMI 0 G23[2] NAME G23[2] '_est_2000' PAUS 1 PAUSed batch file execution MCMC 1 1000 1 c1090 c1091 c1003 c1004 1 4 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 58608.210705 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 58248.673304 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 58267.456376 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 58636.755881 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 58239.855677 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 58512.856064 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 58392.965911 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 58321.745510 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 58455.093521 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 58181.344993 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 58466.481574 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 58197.443584 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 58587.326145 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 58346.589729 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 58442.599511 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 58371.015311 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 58164.325362 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 58433.846007 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 58448.840361 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 58567.473335 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 3000 Average = 58377. S.D. = 145.56 S.E.M. = 2.6576 DAMI 0 G23[3] NAME G23[3] '_est_3000' PAUS 1 PAUSed batch file execution MCMC 1 1000 1 c1090 c1091 c1003 c1004 1 4 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 58464.715229 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 58320.208115 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 58387.516412 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 58381.211969 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 58144.238591 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 58376.205533 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 58329.013052 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 58679.612816 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 58322.651225 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 58452.163490 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 58308.331651 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 58572.594004 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 58387.619283 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 58502.206495 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 58560.004220 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 58396.264804 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 58578.202365 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 58370.495965 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 58196.147649 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 58340.995040 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 4000 Average = 58373. S.D. = 143.31 S.E.M. = 2.2660 DAMI 0 G23[4] NAME G23[4] '_est_4000' PAUS 1 PAUSed batch file execution MCMC 1 1000 1 c1090 c1091 c1003 c1004 1 4 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 58127.908012 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 58456.645899 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 58345.547504 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 58400.508154 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 58683.533673 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 58551.480112 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 58442.326386 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 58450.727795 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 58389.947324 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 58358.027680 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 58295.877720 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 58415.807499 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 58477.117497 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 58356.940024 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 58135.517382 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 58473.907272 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 58515.967143 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 58080.449766 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 58642.873944 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 58152.081593 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 58373. S.D. = 143.66 S.E.M. = 2.0317 DAMI 0 G23[5] NAME G23[5] '_est_5000' PAUS 1 PAUSed batch file execution LINK 0 G23 PSTA 'C:/Users/edcmjc/AppData/Local/Temp/RtmpiYRdS7/MIfile_33182d397d.dta' '_est_1000' '_est_2000' '_est_3000' '_est_4000' '_est_5000' 'resp_indicator' ERAS '_est_1000' '_est_2000' '_est_3000' '_est_4000' '_est_5000' ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.11) multilevel model (Multivariate Normal) N min mean max N_complete min_complete mean_complete max_complete school 99 12 24.63636 34 99 12 24.63636 34 Estimation algorithm: MCMC Elapsed time : 32.41s Number of obs: 2439 (from total 2439) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 58372.560 54340.298 4032.262 62404.822 --------------------------------------------------------------------------------------------------- The model formula: c(es_core, biol_core, biol_r3, biol_r4, phys_core, phys_r2) ~ 1 + female + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_es_core 8.37900 0.07986 104.92 0 *** 8.21960 8.53159 413 Intercept_biol_core 7.10907 0.10208 69.64 0 *** 6.90494 7.29759 255 Intercept_biol_r3 6.84619 0.11218 61.03 0 *** 6.62460 7.06794 537 Intercept_biol_r4 5.91972 0.17428 33.97 6.727e-253 *** 5.57955 6.26541 306 Intercept_phys_core 7.52105 0.12061 62.36 0 *** 7.28389 7.74625 257 Intercept_phys_r2 6.63456 0.13172 50.37 0 *** 6.38068 6.89431 421 femaleFemale_es_core -0.02990 0.05935 -0.50 0.6144 -0.14618 0.08577 4611 femaleFemale_biol_core -0.14966 0.06626 -2.26 0.02389 * -0.28097 -0.01745 5324 femaleFemale_biol_r3 0.03971 0.12631 0.31 0.7532 -0.20636 0.28295 1718 femaleFemale_biol_r4 -0.48910 0.13743 -3.56 0.0003722 *** -0.75416 -0.22000 1489 femaleFemale_phys_core -0.69577 0.07440 -9.35 8.61e-21 *** -0.84020 -0.54998 4554 femaleFemale_phys_r2 -0.69610 0.11675 -5.96 2.486e-09 *** -0.92241 -0.46963 1733 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_es_core 0.43803 0.07487 0.31392 0.60285 3215 cov_Intercept_es_core_Intercept_biol_core 0.41119 0.08420 0.26763 0.59495 3153 var_Intercept_biol_core 0.82125 0.13503 0.59440 1.11741 2981 cov_Intercept_es_core_Intercept_biol_r3 0.21354 0.06628 0.09381 0.35629 1094 cov_Intercept_biol_core_Intercept_biol_r3 0.39051 0.09386 0.22772 0.59285 1146 var_Intercept_biol_r3 0.39965 0.09553 0.24168 0.61188 695 cov_Intercept_es_core_Intercept_biol_r4 0.44429 0.12398 0.22369 0.72042 2286 cov_Intercept_biol_core_Intercept_biol_r4 0.87275 0.18241 0.56171 1.27588 2291 cov_Intercept_biol_r3_Intercept_biol_r4 0.40669 0.13983 0.15328 0.70131 1175 var_Intercept_biol_r4 1.99055 0.34876 1.40703 2.76056 1640 cov_Intercept_es_core_Intercept_phys_core 0.40597 0.09349 0.24762 0.61380 3249 cov_Intercept_biol_core_Intercept_phys_core 0.86589 0.14688 0.62175 1.19666 3555 cov_Intercept_biol_r3_Intercept_phys_core 0.51096 0.11171 0.32308 0.75895 1301 cov_Intercept_biol_r4_Intercept_phys_core 0.94981 0.20952 0.59408 1.40642 2618 var_Intercept_phys_core 1.13454 0.18565 0.82600 1.55653 3189 cov_Intercept_es_core_Intercept_phys_r2 0.37247 0.09385 0.20894 0.57701 2178 cov_Intercept_biol_core_Intercept_phys_r2 0.71450 0.13745 0.48448 1.01875 2497 cov_Intercept_biol_r3_Intercept_phys_r2 0.36151 0.10584 0.17360 0.58532 921 cov_Intercept_biol_r4_Intercept_phys_r2 0.93004 0.21131 0.57610 1.38649 1689 cov_Intercept_phys_core_Intercept_phys_r2 0.84364 0.16216 0.56692 1.20425 2758 var_Intercept_phys_r2 1.01996 0.18962 0.69666 1.43432 1695 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_es_core 2.06730 0.06081 1.95387 2.18963 4700 cov_Intercept_es_core_Intercept_biol_core 0.63725 0.05019 0.53944 0.73676 4582 var_Intercept_biol_core 2.61766 0.07617 2.47231 2.76783 4523 cov_Intercept_es_core_Intercept_biol_r3 0.38869 0.09107 0.20675 0.56569 1539 cov_Intercept_biol_core_Intercept_biol_r3 0.47710 0.10031 0.28365 0.67721 1619 var_Intercept_biol_r3 4.83774 0.19712 4.46665 5.23799 1482 cov_Intercept_es_core_Intercept_biol_r4 0.47029 0.09913 0.27304 0.66333 1597 cov_Intercept_biol_core_Intercept_biol_r4 1.03681 0.12232 0.80025 1.28251 1282 cov_Intercept_biol_r3_Intercept_biol_r4 1.06760 0.25440 0.55305 1.57484 434 var_Intercept_biol_r4 5.89405 0.25385 5.40734 6.41227 1369 cov_Intercept_es_core_Intercept_phys_core 0.66213 0.05417 0.55752 0.77348 5009 cov_Intercept_biol_core_Intercept_phys_core 1.19978 0.06485 1.07336 1.33083 4598 cov_Intercept_biol_r3_Intercept_phys_core 0.41408 0.11126 0.19990 0.63681 1688 cov_Intercept_biol_r4_Intercept_phys_core 1.16247 0.12604 0.91777 1.41068 1599 var_Intercept_phys_core 3.15598 0.09282 2.97850 3.34447 4464 cov_Intercept_es_core_Intercept_phys_r2 0.66661 0.08404 0.50303 0.83003 1658 cov_Intercept_biol_core_Intercept_phys_r2 1.15000 0.09710 0.96572 1.34553 1584 cov_Intercept_biol_r3_Intercept_phys_r2 0.66309 0.21365 0.25330 1.09204 340 cov_Intercept_biol_r4_Intercept_phys_r2 1.92358 0.21685 1.49658 2.33805 568 cov_Intercept_phys_core_Intercept_phys_r2 1.55771 0.10891 1.35021 1.77184 1546 var_Intercept_phys_r2 4.52838 0.18774 4.17580 4.90464 1533 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > head(mymodel@data) es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student Intercept 1 10.0000 7 10.0 NA 6 4.2857 1018 1 1 2 6.6667 6 NA 7.5 7 10.0000 1018 2 1 3 8.3333 8 10.0 7.5 5 NA 1018 3 1 4 10.0000 6 NA NA 8 10.0000 1018 4 1 5 8.3333 7 7.5 NA 7 NA 1018 5 1 6 6.6667 7 NA 5.0 6 NA 1018 6 1 femaleFemale 1 1 2 0 3 1 4 0 5 1 6 1 > if (!require(mitools)) { + warning("mitools package required to use imputationList() function") + } else { + mi <- imputationList(mymodel@imputations) + with(mi, fun=head) + } Loading required package: mitools $chain1_iteration_1000 es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student 1 10.0000 7 10.000000 12.123716 6 4.285700 1018 1 2 6.6667 6 7.255589 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 6.242382 1018 3 4 10.0000 6 6.079620 4.421116 8 10.000000 1018 4 5 8.3333 7 7.500000 5.499372 7 8.859745 1018 5 6 6.6667 7 5.263067 5.000000 6 2.714720 1018 6 Intercept femaleFemale 1 1 1 2 1 0 3 1 1 4 1 0 5 1 1 6 1 1 $chain1_iteration_2000 es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student 1 10.0000 7 10.000000 8.568636 6 4.285700 1018 1 2 6.6667 6 7.799933 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 3.365414 1018 3 4 10.0000 6 6.549963 7.526566 8 10.000000 1018 4 5 8.3333 7 7.500000 4.779687 7 5.743311 1018 5 6 6.6667 7 4.475630 5.000000 6 3.304127 1018 6 Intercept femaleFemale 1 1 1 2 1 0 3 1 1 4 1 0 5 1 1 6 1 1 $chain1_iteration_3000 es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student 1 10.0000 7 10.000000 7.044004 6 4.285700 1018 1 2 6.6667 6 9.207521 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 7.072733 1018 3 4 10.0000 6 10.462209 8.295353 8 10.000000 1018 4 5 8.3333 7 7.500000 6.464687 7 8.399819 1018 5 6 6.6667 7 8.921084 5.000000 6 6.063890 1018 6 Intercept femaleFemale 1 1 1 2 1 0 3 1 1 4 1 0 5 1 1 6 1 1 $chain1_iteration_4000 es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student 1 10.0000 7 10.000000 5.568816 6 4.285700 1018 1 2 6.6667 6 6.043774 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 9.141410 1018 3 4 10.0000 6 8.855500 5.286454 8 10.000000 1018 4 5 8.3333 7 7.500000 7.940201 7 7.317906 1018 5 6 6.6667 7 6.428131 5.000000 6 5.479529 1018 6 Intercept femaleFemale 1 1 1 2 1 0 3 1 1 4 1 0 5 1 1 6 1 1 $chain1_iteration_5000 es_core biol_core biol_r3 biol_r4 phys_core phys_r2 school student 1 10.0000 7 10.000000 7.195869 6 4.285700 1018 1 2 6.6667 6 4.548929 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 5.685029 1018 3 4 10.0000 6 8.298112 8.098084 8 10.000000 1018 4 5 8.3333 7 7.500000 6.067368 7 4.489384 1018 5 6 6.6667 7 4.568118 5.000000 6 2.819186 1018 6 Intercept femaleFemale 1 1 1 2 1 0 3 1 1 4 1 0 5 1 1 6 1 1 attr(,"call") with(mi, fun = head) > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . .128 > > ## reinstate par settings > par(mypar) > > > > ############################################################################ > > proc.time() user system elapsed 7.43 1.14 67.68