R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) 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. Natural language support but running in an English locale 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-2017 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.05/ 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.05) multilevel model (Multivariate Normal) Estimation algorithm: IGLS Elapsed time : 0.2s 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 for 50 iterations out of 500 -2 * Loglike = 24715.167725 Burning in for 100 iterations out of 500 -2 * Loglike = 24711.823123 Burning in for 150 iterations out of 500 -2 * Loglike = 24707.853231 Burning in for 200 iterations out of 500 -2 * Loglike = 24710.964703 Burning in for 250 iterations out of 500 -2 * Loglike = 24710.181211 Burning in for 300 iterations out of 500 -2 * Loglike = 24711.623446 Burning in for 350 iterations out of 500 -2 * Loglike = 24715.033589 Burning in for 400 iterations out of 500 -2 * Loglike = 24708.821923 Burning in for 450 iterations out of 500 -2 * Loglike = 24710.342828 Burning in for 500 iterations out of 500 -2 * Loglike = 24717.462188 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 = 24711.916143 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 24708.255564 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 24710.303449 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 24712.646460 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 24709.495191 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 24717.649037 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 24707.811238 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 24715.700103 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 24713.102917 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 24708.841718 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 24714.562204 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 24708.867475 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 24718.879339 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 24709.338639 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 24712.162045 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 24708.198985 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 24713.491104 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 24715.176980 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 24715.954324 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 24709.913047 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 24708.010160 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 24724.398813 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 24712.825461 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 24706.972368 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 24710.392622 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 24712.014986 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 24712.530155 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 24709.280122 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 24709.631903 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 24711.872015 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 24713.943698 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 24714.056143 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 24712.381865 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 24712.838913 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 24709.235640 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 24712.486862 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 24712.694346 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 24711.862579 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 24707.726977 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 24713.478392 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 24715.475528 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 24707.587885 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 24709.146240 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 24710.481315 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 24711.364867 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 24710.418401 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 24709.525019 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 24708.951447 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 24709.794282 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 24710.278971 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 24709.835629 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 24714.867518 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 24708.827008 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 24707.948611 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 24712.778317 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 24715.693641 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 24709.106106 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 24709.097447 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 24709.985568 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 24716.278663 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 24712.634299 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 24711.849876 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 24712.025412 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 24712.718743 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 24708.064149 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 24711.134952 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 24706.566946 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 24707.149953 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 24710.315491 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 24712.153552 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 24708.943161 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 24710.981859 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 24707.912547 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 24711.339033 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 24707.662198 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 24709.090048 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 24714.224636 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 24710.449901 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 24706.740663 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 24715.555980 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 24714.557692 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 24707.135258 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 24709.043039 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 24709.481746 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 24712.637279 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 24712.057334 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 24711.165538 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 24710.054754 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 24712.493266 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 24708.521703 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 24713.382352 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 24710.547175 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 24714.026718 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 24711.163871 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 24711.246675 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 24713.332209 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 24712.280148 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 24709.281125 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 24713.816069 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 24714.148071 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 24711. S.D. = 3.1994 S.E.M. = 0.045246 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 1.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 24711.211 24706.245 4.966 24716.177 --------------------------------------------------------------------------------------------------- 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.93472 0.34033 137.91 0 *** 46.27051 47.58569 5438 Intercept_csework 73.43046 0.42052 174.62 0 *** 72.62514 74.27575 5195 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.41260 6.55904 170.04483 195.75447 4619 cov_Intercept_written_Intercept_csework 105.39581 6.27642 93.48509 118.33852 5000 var_Intercept_csework 270.24990 9.85175 251.83896 290.38533 6031 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 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 for 50 iterations out of 500 -2 * Loglike = 24568.281141 Burning in for 100 iterations out of 500 -2 * Loglike = 24562.460647 Burning in for 150 iterations out of 500 -2 * Loglike = 24567.707332 Burning in for 200 iterations out of 500 -2 * Loglike = 24565.383734 Burning in for 250 iterations out of 500 -2 * Loglike = 24564.738855 Burning in for 300 iterations out of 500 -2 * Loglike = 24565.098809 Burning in for 350 iterations out of 500 -2 * Loglike = 24560.587256 Burning in for 400 iterations out of 500 -2 * Loglike = 24569.086918 Burning in for 450 iterations out of 500 -2 * Loglike = 24564.380475 Burning in for 500 iterations out of 500 -2 * Loglike = 24567.110257 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 = 24565.929103 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 24564.555509 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 24567.508510 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 24567.699686 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 24565.209783 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 24569.022125 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 24563.857577 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 24578.700946 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 24563.821779 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 24566.366078 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 24572.681255 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 24572.049789 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 24564.624809 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 24571.066052 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 24569.727592 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 24568.292872 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 24571.668244 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 24563.039454 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 24563.654067 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 24562.791167 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 24561.121755 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 24564.256578 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 24565.481159 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 24566.213184 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 24572.983116 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 24564.670290 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 24566.253311 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 24570.325158 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 24568.900791 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 24566.335503 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 24567.610260 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 24570.050710 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 24566.370039 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 24564.717643 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 24567.265749 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 24568.335900 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 24569.000708 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 24562.545592 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 24570.583515 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 24566.637525 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 24565.698957 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 24572.760287 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 24560.045256 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 24573.343825 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 24566.701120 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 24565.025201 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 24569.474091 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 24572.645102 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 24570.243171 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 24569.742647 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 24566.253885 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 24568.079904 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 24560.794089 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 24564.010240 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 24562.007227 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 24567.302911 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 24567.179184 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 24565.841911 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 24561.562332 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 24570.907030 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 24570.730242 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 24563.827426 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 24563.520003 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 24570.074754 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 24568.650538 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 24567.183273 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 24569.455763 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 24569.550314 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 24564.310535 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 24562.221421 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 24565.474836 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 24562.858312 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 24582.365794 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 24563.329227 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 24565.187542 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 24564.070298 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 24568.657602 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 24560.877277 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 24564.191339 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 24575.512288 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 24562.358132 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 24562.997834 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 24571.648284 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 24563.124848 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 24564.527684 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 24565.850186 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 24564.104512 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 24562.684209 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 24563.243775 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 24563.369016 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 24562.202109 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 24568.232103 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 24563.580645 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 24573.767377 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 24561.774436 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 24567.335900 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 24573.871363 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 24564.818889 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 24565.111185 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 24565.959848 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 24566. S.D. = 3.7625 S.E.M. = 0.053210 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 1.49s 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.172 24559.196 6.976 24573.148 --------------------------------------------------------------------------------------------------- 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.90422 0.53510 91.39 0 *** 47.86913 49.95198 5000 Intercept_csework 69.74135 0.64421 108.26 0 *** 68.52173 71.03155 5000 femaleFemale_written -3.32836 0.69761 -4.77 1.832e-06 *** -4.68065 -1.97640 5000 femaleFemale_csework 6.24558 0.83270 7.50 6.363e-14 *** 4.56257 7.87662 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 179.68092 6.47570 167.59421 193.04257 5000 cov_Intercept_written_Intercept_csework 110.57329 6.13040 98.64093 122.95368 5258 var_Intercept_csework 261.26932 9.55897 243.11617 280.65931 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 for 50 iterations out of 500 -2 * Loglike = 23504.664959 Burning in for 100 iterations out of 500 -2 * Loglike = 23522.842565 Burning in for 150 iterations out of 500 -2 * Loglike = 23524.042444 Burning in for 200 iterations out of 500 -2 * Loglike = 23529.614587 Burning in for 250 iterations out of 500 -2 * Loglike = 23498.056033 Burning in for 300 iterations out of 500 -2 * Loglike = 23507.630834 Burning in for 350 iterations out of 500 -2 * Loglike = 23514.402956 Burning in for 400 iterations out of 500 -2 * Loglike = 23538.690294 Burning in for 450 iterations out of 500 -2 * Loglike = 23558.767641 Burning in for 500 iterations out of 500 -2 * Loglike = 23518.887862 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 = 23545.220600 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 23480.984113 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 23496.697770 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 23543.692573 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 23553.376526 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 23504.471162 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 23531.881650 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 23522.680656 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 23522.144374 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 23520.323112 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 23513.127071 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 23529.310397 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 23525.952856 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 23525.242768 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 23508.142424 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 23515.886962 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 23574.354958 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 23523.675365 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 23508.244198 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 23528.692061 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 23479.109750 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 23539.095928 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 23559.340910 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 23528.436521 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 23513.485019 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 23530.345199 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 23532.563175 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 23548.213959 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 23511.787110 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 23529.663836 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 23522.942555 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 23506.615530 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 23512.437817 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 23517.175005 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 23517.661747 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 23517.637506 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 23536.410250 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 23515.228640 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 23520.954366 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 23539.206844 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 23548.062536 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 23535.139352 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 23539.459125 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 23496.169121 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 23515.702916 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 23511.837530 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 23507.282220 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 23520.865624 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 23533.749730 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 23521.855871 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 23513.574246 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 23515.772519 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 23528.735462 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 23500.333618 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 23539.357941 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 23536.228166 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 23523.389947 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 23513.924848 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 23559.058151 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 23551.735128 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 23545.320507 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 23535.221430 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 23509.089761 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 23503.073515 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 23531.077661 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 23526.159963 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 23504.877205 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 23516.872656 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 23522.084365 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 23505.054828 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 23503.510120 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 23537.140625 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 23534.437689 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 23549.284190 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 23517.824583 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 23542.382855 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 23544.466631 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 23535.882356 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 23525.809177 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 23546.425247 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 23549.781798 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 23508.665549 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 23512.131338 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 23506.394054 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 23530.379894 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 23518.694346 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 23516.002252 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 23509.660150 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 23512.910539 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 23533.990128 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 23516.233386 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 23516.243563 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 23536.154259 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 23495.994053 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 23528.224452 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 23515.896960 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 23532.486713 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 23532.124859 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 23505.132356 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 23520.762551 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 23524. S.D. = 17.695 S.E.M. = 0.25025 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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 : 3.05s 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 23523.836 23397.629 126.208 23650.044 --------------------------------------------------------------------------------------------------- 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.51727 0.95429 51.89 0 *** 47.61981 51.35287 323 Intercept_csework 69.68990 1.20742 57.72 0 *** 67.29713 72.03590 280 femaleFemale_written -2.43468 0.60530 -4.02 5.764e-05 *** -3.61457 -1.25755 4684 femaleFemale_csework 7.00570 0.73927 9.48 2.629e-21 *** 5.60734 8.47061 4331 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.30344 10.74906 34.90719 76.90354 2568 cov_Intercept_written_Intercept_csework 29.24192 10.09670 12.12390 50.78904 2688 var_Intercept_csework 79.00190 16.13521 52.88268 116.74725 2680 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 125.33862 4.73379 116.34988 135.27114 4617 cov_Intercept_written_Intercept_csework 74.45204 4.50973 66.02909 83.75247 4666 var_Intercept_csework 184.24917 6.92837 170.93396 198.17814 4621 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > 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 for 50 iterations out of 500 -2 * Loglike = 30651.112963 Burning in for 100 iterations out of 500 -2 * Loglike = 30641.446580 Burning in for 150 iterations out of 500 -2 * Loglike = 30688.758108 Burning in for 200 iterations out of 500 -2 * Loglike = 30680.109943 Burning in for 250 iterations out of 500 -2 * Loglike = 30678.625138 Burning in for 300 iterations out of 500 -2 * Loglike = 30628.520478 Burning in for 350 iterations out of 500 -2 * Loglike = 30677.126225 Burning in for 400 iterations out of 500 -2 * Loglike = 30753.121272 Burning in for 450 iterations out of 500 -2 * Loglike = 30682.105682 Burning in for 500 iterations out of 500 -2 * Loglike = 30687.063692 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 = 30642.273188 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 30710.780109 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 30656.300474 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 30677.616919 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 30679.653403 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 30695.071091 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 30658.799691 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 30668.603106 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 30754.454416 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 30668.179936 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 30707.232562 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 30670.018877 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 30653.713292 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 30654.738580 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 30709.680185 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 30661.690392 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 30673.263647 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 30717.516670 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 30612.156852 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 30678.685962 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 30717.176571 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 30640.415123 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 30702.054586 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 30687.873549 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 30691.785393 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 30679.630908 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 30670.976400 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 30719.325380 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 30711.175321 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 30628.440846 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 30699.159892 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 30675.841231 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 30705.100004 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 30664.220333 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 30627.797183 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 30706.404538 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 30709.963011 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 30646.435564 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 30697.226873 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 30710.046785 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 30681.622393 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 30668.185411 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 30678.986933 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 30644.207094 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 30682.571877 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 30671.961070 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 30658.549942 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 30706.826613 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 30648.296919 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 30735.506487 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 30697.601543 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 30710.384426 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 30672.998694 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 30659.436194 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 30708.016891 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 30739.995431 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 30649.113080 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 30728.954651 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 30660.876225 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 30737.908639 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 30642.662057 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 30641.395951 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 30650.871348 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 30642.149617 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 30639.422017 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 30655.441018 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 30675.089903 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 30727.908947 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 30634.029609 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 30698.510054 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 30750.410705 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 30681.081580 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 30658.720790 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 30710.244902 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 30717.890515 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 30702.114360 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 30689.722478 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 30658.471710 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 30702.961673 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 30645.691455 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 30691.123355 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 30694.939500 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 30666.021047 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 30718.854279 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 30699.195432 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 30650.999563 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 30698.860349 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 30668.440205 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 30637.186207 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 30676.005536 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 30620.816706 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 30648.521105 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 30703.410137 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 30635.753639 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 30679.936599 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 30652.092603 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 30661.916471 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 30621.786072 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 30691.255284 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 30686.002152 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 30681. S.D. = 29.961 S.E.M. = 0.42372 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multivariate Normal) Estimation algorithm: MCMC Elapsed time : 2.22s 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.758 30292.088 388.670 31069.429 --------------------------------------------------------------------------------------------------- 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.80068 0.49337 98.91 0 *** 47.81865 49.76957 4359 Intercept_csework 69.80776 0.60165 116.03 0 *** 68.63450 70.97523 3865 femaleFemale_written -3.42845 0.63604 -5.39 7.034e-08 *** -4.67173 -2.15633 3889 femaleFemale_csework 5.92975 0.78214 7.58 3.418e-14 *** 4.40694 7.49959 4288 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.66806 6.20849 165.13017 189.42504 4074 cov_Intercept_written_Intercept_csework 107.93326 5.90549 96.83496 119.81476 3904 var_Intercept_csework 257.83095 8.78792 241.11577 275.47575 4109 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > (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 for 50 iterations out of 500 -2 * Loglike = 29344.092049 Burning in for 100 iterations out of 500 -2 * Loglike = 29401.578264 Burning in for 150 iterations out of 500 -2 * Loglike = 29415.591400 Burning in for 200 iterations out of 500 -2 * Loglike = 29354.585513 Burning in for 250 iterations out of 500 -2 * Loglike = 29381.781452 Burning in for 300 iterations out of 500 -2 * Loglike = 29405.866082 Burning in for 350 iterations out of 500 -2 * Loglike = 29397.302156 Burning in for 400 iterations out of 500 -2 * Loglike = 29422.558190 Burning in for 450 iterations out of 500 -2 * Loglike = 29367.591939 Burning in for 500 iterations out of 500 -2 * Loglike = 29360.937446 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 = 29391.141641 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 29334.570345 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 29421.237420 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 29365.855688 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 29351.299066 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 29322.816250 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 29363.037133 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 29394.529273 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 29392.703646 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 29333.789308 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 29370.875517 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 29431.918095 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 29380.929398 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 29372.559301 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 29330.564249 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 29400.067070 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 29417.911304 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 29397.994131 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 29378.519333 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 29365.234060 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 29384.029248 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 29343.739137 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 29358.199793 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 29372.194512 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 29395.009563 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 29367.085651 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 29475.215336 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 29439.357931 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 29405.371043 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 29399.796973 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 29354.958989 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 29374.375253 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 29414.312345 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 29389.289862 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 29351.576955 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 29328.258293 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 29356.803998 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 29362.037378 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 29365.561130 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 29442.950559 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 29383.137793 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 29415.557014 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 29448.221423 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 29425.990340 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 29399.473577 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 29407.574310 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 29434.440078 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 29492.549448 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 29422.780586 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 29412.663806 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 29398.304156 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 29384.891790 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 29382.425594 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 29400.634883 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 29375.928665 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 29294.316512 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 29399.868003 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 29403.852504 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 29386.611403 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 29425.484442 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 29410.035665 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 29402.903853 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 29418.920734 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 29373.509865 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 29342.105343 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 29445.607210 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 29389.173894 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 29359.140503 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 29403.025232 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 29341.426490 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 29478.319653 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 29364.995094 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 29404.363581 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 29347.243246 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 29383.452138 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 29397.985076 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 29360.931755 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 29348.741922 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 29409.959015 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 29372.321578 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 29413.821167 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 29404.678712 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 29407.672468 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 29388.141439 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 29391.706761 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 29390.341535 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 29380.034708 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 29381.163539 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 29431.180648 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 29375.076942 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 29416.458045 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 29412.806474 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 29393.727196 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 29497.511616 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 29355.546432 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 29420.519489 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 29427.436095 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 29365.386649 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 29408.129947 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 29367.944266 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 29389. S.D. = 36.134 S.E.M. = 0.51102 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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.77s 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 29389.303 28877.951 511.352 29900.655 --------------------------------------------------------------------------------------------------- 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.57791 0.93277 53.15 0 *** 47.69340 51.31091 254 Intercept_csework 69.72576 1.22424 56.95 0 *** 67.35989 72.16289 204 femaleFemale_written -2.50509 0.57450 -4.36 1.298e-05 *** -3.64086 -1.40406 3537 femaleFemale_csework 6.73538 0.67492 9.98 1.874e-23 *** 5.46147 8.07613 3541 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.74115 10.07206 33.67526 72.91785 2586 cov_Intercept_written_Intercept_csework 26.53397 9.62270 9.61490 47.66072 2775 var_Intercept_csework 80.37989 16.02878 53.87081 118.18761 2293 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_written 125.01605 4.35738 116.62482 133.94057 3659 cov_Intercept_written_Intercept_csework 73.19133 4.10512 65.32227 81.21847 3532 var_Intercept_csework 180.60366 6.21059 168.76025 192.97747 3810 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 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.05) 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 : 11.16s 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 for 50 iterations out of 500 -2 * Loglike = 58696.082742 Burning in for 100 iterations out of 500 -2 * Loglike = 58343.785928 Burning in for 150 iterations out of 500 -2 * Loglike = 58343.453673 Burning in for 200 iterations out of 500 -2 * Loglike = 58540.452250 Burning in for 250 iterations out of 500 -2 * Loglike = 58138.939531 Burning in for 300 iterations out of 500 -2 * Loglike = 58388.394952 Burning in for 350 iterations out of 500 -2 * Loglike = 58506.644027 Burning in for 400 iterations out of 500 -2 * Loglike = 58285.492680 Burning in for 450 iterations out of 500 -2 * Loglike = 58519.825370 Burning in for 500 iterations out of 500 -2 * Loglike = 58230.976054 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 = 58227.538857 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 58138.588982 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 58633.254751 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 58182.594676 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 58402.654587 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 58367.137314 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 58624.934306 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 58144.295680 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 58557.877094 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 58431.256533 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 58672.200416 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 58225.310468 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 58261.214819 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 58363.172249 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 58401.252639 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 58449.891774 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 58294.344386 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 58384.201194 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 58427.916029 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 58439.283291 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 1000 Average = 58377. S.D. = 142.16 S.E.M. = 4.4954 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 = 58391.531909 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 58370.942584 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 58397.265869 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 58445.341255 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 58454.075499 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 58387.242209 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 58377.585653 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 58457.681489 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 58545.796725 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 58448.919548 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 58530.559781 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 58482.861398 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 58278.641602 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 58580.306461 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 58167.729865 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 58270.275447 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 58434.228988 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 58566.123462 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 58582.599986 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 58489.678604 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 2000 Average = 58374. S.D. = 142.49 S.E.M. = 3.1861 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 = 58423.817700 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 58457.003397 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 58293.068144 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 58442.502054 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 58456.306300 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 58399.794398 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 58182.224894 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 58444.622054 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 58504.863626 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 58544.916561 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 58494.145994 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 58572.486056 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 58601.152096 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 58352.592421 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 58403.019739 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 58486.875585 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 58130.766778 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 58470.359425 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 58222.911424 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 58286.282611 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 3000 Average = 58377. S.D. = 143.13 S.E.M. = 2.6132 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 = 58528.887120 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 58527.595285 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 58459.244578 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 58470.232564 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 58359.600864 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 58429.976589 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 58443.572199 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 58457.875884 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 58266.911768 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 58369.191300 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 58338.263026 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 58225.963688 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 58440.853928 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 58423.724514 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 58451.015175 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 58388.544491 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 58319.853550 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 58314.011581 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 58424.372222 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 58288.613247 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 4000 Average = 58378. S.D. = 141.20 S.E.M. = 2.2325 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 = 58188.757117 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 58269.746255 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 58355.577462 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 58427.813616 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 58405.941419 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 58450.550537 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 58117.273135 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 58591.578247 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 58397.768997 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 58350.466371 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 58330.795335 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 58480.360050 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 58022.729573 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 58395.135284 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 58377.143478 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 58499.330294 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 58280.370562 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 58481.450550 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 58464.421551 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 58265.895516 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 58380. S.D. = 141.60 S.E.M. = 2.0025 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/Rtmpyg2ViD/MIfile_3c4c111f3adc.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.05) 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.75s 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 58379.893 54347.315 4032.579 62412.472 --------------------------------------------------------------------------------------------------- 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.37294 0.07871 106.38 0 *** 8.22220 8.52807 482 Intercept_biol_core 7.09322 0.10435 67.97 0 *** 6.88921 7.30053 240 Intercept_biol_r3 6.83760 0.10940 62.50 0 *** 6.62205 7.04702 897 Intercept_biol_r4 5.89428 0.17318 34.04 6.427e-254 *** 5.56280 6.24468 328 Intercept_phys_core 7.50131 0.11819 63.47 0 *** 7.26877 7.73475 243 Intercept_phys_r2 6.61616 0.13141 50.35 0 *** 6.35607 6.87262 343 femaleFemale_es_core -0.03099 0.05991 -0.52 0.605 -0.14707 0.08633 4231 femaleFemale_biol_core -0.15139 0.06751 -2.24 0.02493 * -0.28484 -0.02171 5607 femaleFemale_biol_r3 0.03542 0.12871 0.28 0.7832 -0.22272 0.28212 1559 femaleFemale_biol_r4 -0.49575 0.14019 -3.54 0.0004059 *** -0.77123 -0.22288 1517 femaleFemale_phys_core -0.69520 0.07287 -9.54 1.426e-21 *** -0.83840 -0.55197 4769 femaleFemale_phys_r2 -0.69466 0.11675 -5.95 2.684e-09 *** -0.92245 -0.46271 1565 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.43980 0.07479 0.31444 0.60688 2766 cov_Intercept_es_core_Intercept_biol_core 0.40930 0.08313 0.26683 0.59216 3051 var_Intercept_biol_core 0.81671 0.13323 0.59502 1.12616 2987 cov_Intercept_es_core_Intercept_biol_r3 0.21250 0.06709 0.09379 0.35685 950 cov_Intercept_biol_core_Intercept_biol_r3 0.38228 0.09131 0.22480 0.57938 1117 var_Intercept_biol_r3 0.39071 0.09646 0.23150 0.60621 615 cov_Intercept_es_core_Intercept_biol_r4 0.43861 0.12416 0.21614 0.70769 2403 cov_Intercept_biol_core_Intercept_biol_r4 0.86814 0.17985 0.56107 1.26933 2697 cov_Intercept_biol_r3_Intercept_biol_r4 0.40226 0.13766 0.15112 0.69872 899 var_Intercept_biol_r4 1.98600 0.34741 1.40511 2.76820 1875 cov_Intercept_es_core_Intercept_phys_core 0.40462 0.09189 0.24533 0.59921 2840 cov_Intercept_biol_core_Intercept_phys_core 0.85803 0.14387 0.62316 1.18384 3522 cov_Intercept_biol_r3_Intercept_phys_core 0.49868 0.10951 0.30864 0.73652 1269 cov_Intercept_biol_r4_Intercept_phys_core 0.93814 0.20544 0.59114 1.37903 2557 var_Intercept_phys_core 1.12063 0.18030 0.82470 1.51509 3441 cov_Intercept_es_core_Intercept_phys_r2 0.37183 0.09195 0.21033 0.57192 1784 cov_Intercept_biol_core_Intercept_phys_r2 0.70912 0.13679 0.47527 1.01685 2263 cov_Intercept_biol_r3_Intercept_phys_r2 0.35878 0.10557 0.16575 0.58374 891 cov_Intercept_biol_r4_Intercept_phys_r2 0.92790 0.20902 0.56490 1.40035 2090 cov_Intercept_phys_core_Intercept_phys_r2 0.83773 0.16017 0.56981 1.19241 2471 var_Intercept_phys_r2 1.01802 0.18521 0.70273 1.43662 1614 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_es_core 2.06545 0.05992 1.94981 2.18197 4567 cov_Intercept_es_core_Intercept_biol_core 0.63600 0.04952 0.54409 0.73340 4448 var_Intercept_biol_core 2.61459 0.07606 2.46651 2.76556 5186 cov_Intercept_es_core_Intercept_biol_r3 0.38486 0.09082 0.20697 0.56211 1652 cov_Intercept_biol_core_Intercept_biol_r3 0.47115 0.10278 0.27449 0.67713 1696 var_Intercept_biol_r3 4.83723 0.20314 4.45706 5.24543 1443 cov_Intercept_es_core_Intercept_biol_r4 0.46979 0.10000 0.27558 0.66570 1384 cov_Intercept_biol_core_Intercept_biol_r4 1.03875 0.12068 0.79872 1.27913 1285 cov_Intercept_biol_r3_Intercept_biol_r4 1.04810 0.26777 0.50141 1.57132 400 var_Intercept_biol_r4 5.89408 0.25201 5.42073 6.40072 1304 cov_Intercept_es_core_Intercept_phys_core 0.66155 0.05438 0.55793 0.77011 4626 cov_Intercept_biol_core_Intercept_phys_core 1.19802 0.06465 1.07600 1.32848 4490 cov_Intercept_biol_r3_Intercept_phys_core 0.41337 0.11579 0.18247 0.64076 1643 cov_Intercept_biol_r4_Intercept_phys_core 1.16180 0.12683 0.91504 1.41108 1427 var_Intercept_phys_core 3.15537 0.09295 2.97667 3.34705 4709 cov_Intercept_es_core_Intercept_phys_r2 0.66059 0.08308 0.49663 0.82118 1869 cov_Intercept_biol_core_Intercept_phys_r2 1.14167 0.09820 0.95217 1.33406 1732 cov_Intercept_biol_r3_Intercept_phys_r2 0.64444 0.22084 0.21666 1.07607 401 cov_Intercept_biol_r4_Intercept_phys_r2 1.91384 0.22690 1.46458 2.35945 550 cov_Intercept_phys_core_Intercept_phys_r2 1.55145 0.10953 1.34497 1.77022 1725 var_Intercept_phys_r2 4.52318 0.18159 4.18047 4.89874 1538 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > 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 4.724379 6 4.285700 1018 1 2 6.6667 6 5.667503 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 6.044044 1018 3 4 10.0000 6 8.936717 8.232637 8 10.000000 1018 4 5 8.3333 7 7.500000 10.216798 7 6.189163 1018 5 6 6.6667 7 7.023035 5.000000 6 6.052805 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 5.075112 6 4.285700 1018 1 2 6.6667 6 4.235590 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 2.565862 1018 3 4 10.0000 6 8.824922 6.009976 8 10.000000 1018 4 5 8.3333 7 7.500000 8.780800 7 5.306080 1018 5 6 6.6667 7 9.870448 5.000000 6 3.297573 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 5.959568 6 4.285700 1018 1 2 6.6667 6 9.268406 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 7.576240 1018 3 4 10.0000 6 8.125290 8.011205 8 10.000000 1018 4 5 8.3333 7 7.500000 6.220782 7 6.198626 1018 5 6 6.6667 7 5.751807 5.000000 6 3.141899 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 7.993846 6 4.285700 1018 1 2 6.6667 6 8.608494 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 5.701624 1018 3 4 10.0000 6 7.991982 9.678516 8 10.000000 1018 4 5 8.3333 7 7.500000 7.494938 7 6.237312 1018 5 6 6.6667 7 5.851149 5.000000 6 6.310345 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 6.397553 6 4.285700 1018 1 2 6.6667 6 1.369020 7.500000 7 10.000000 1018 2 3 8.3333 8 10.000000 7.500000 5 5.920979 1018 3 4 10.0000 6 5.496566 10.814918 8 10.000000 1018 4 5 8.3333 7 7.500000 1.850508 7 4.815011 1018 5 6 6.6667 7 5.609484 5.000000 6 1.404587 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.79 0.98 67.78