R version 4.3.2 (2023-10-31 ucrt) -- "Eye Holes" Copyright (C) 2023 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 > # > # 4 Other Features of Variance Components Models . . . . . . . . . . . .45 > # > # 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/ > ############################################################################ > > 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.09/ 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) > > ## save current par settings > mypar <- par(no.readonly = TRUE) > > ## Read tutorial data > data(tutorial, package = "R2MLwiN") > > ## IGLS > (mymodel1 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), data = tutorial)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: IGLS Elapsed time : 0.08s Number of obs: 4059 (from total 4059) The model converged after 4 iterations. Log likelihood: -4678.6 Deviance statistic: 9357.2 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept 0.00239 0.04002 0.06 0.9524 -0.07605 0.08083 standlrt 0.56337 0.01247 45.19 0 *** 0.53894 0.58780 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the school level: Coef. Std. Err. var_Intercept 0.09213 0.01815 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. var_Intercept 0.56573 0.01266 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > ## Gibbs > (mymodel2 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1), data = tutorial)) 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 1 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 9206.193266 Burning in for 100 iterations out of 500 -2 * Loglike = 9216.262176 Burning in for 150 iterations out of 500 -2 * Loglike = 9241.057582 Burning in for 200 iterations out of 500 -2 * Loglike = 9214.675885 Burning in for 250 iterations out of 500 -2 * Loglike = 9198.255145 Burning in for 300 iterations out of 500 -2 * Loglike = 9227.186873 Burning in for 350 iterations out of 500 -2 * Loglike = 9222.091977 Burning in for 400 iterations out of 500 -2 * Loglike = 9214.630238 Burning in for 450 iterations out of 500 -2 * Loglike = 9216.522216 Burning in for 500 iterations out of 500 -2 * Loglike = 9201.148603 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 1 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 9212.190791 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9208.377297 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9207.886882 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9195.385976 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9238.483062 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9215.621742 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9205.716499 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9207.158850 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9210.248427 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9228.495732 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9221.683303 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9202.166694 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9237.981658 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9201.878383 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9198.726654 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9214.104227 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9227.156460 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9197.279082 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9191.816267 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9219.178731 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9214.163387 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9218.308723 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9188.214048 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9188.278770 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9208.819913 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9193.939811 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9193.651680 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9215.606479 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9195.925780 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9218.422125 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9202.244183 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9204.907738 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9194.883902 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9214.140517 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9211.397609 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9207.941176 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9216.158993 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9216.821254 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9209.099646 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9205.356036 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9226.820798 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9215.889068 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9204.485567 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9239.773102 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9204.613020 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9205.832435 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9197.787494 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9202.635017 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9202.243753 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9199.686027 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9213.435702 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9215.862131 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9203.440604 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9197.917390 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9225.824248 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9222.623770 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9226.897380 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9197.383677 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9211.390320 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9207.286579 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9217.534200 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9227.872396 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9198.935844 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9203.578259 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9193.257434 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9204.815469 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9200.291358 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9219.578031 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9214.657834 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9213.144417 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9217.997575 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9225.109666 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9212.063094 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9226.746381 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9214.159422 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9204.966122 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9190.735716 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9206.324394 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9205.512200 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9201.017143 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9211.234780 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9211.765768 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9200.968089 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9229.231239 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9207.636298 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9197.507235 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9208.445006 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9231.667774 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9201.470719 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9208.425209 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9216.996959 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9225.405793 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9201.746288 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9212.656436 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9202.976127 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9218.846042 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9200.637551 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9219.146880 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9215.841845 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9212.109834 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9209.1 S.D. = 11.916 S.E.M. = 0.16852 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: MCMC Elapsed time : 1.48s Number of obs: 4059 (from total 4059) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9209.078 9149.069 60.010 9269.088 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (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 0.00318 0.04420 0.07 0.9427 -0.08330 0.09189 223 standlrt 0.56322 0.01258 44.77 0 *** 0.53844 0.58780 3821 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 0.09742 0.01988 0.06472 0.14144 3126 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56617 0.01249 0.54212 0.59090 4751 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 4.1 Metropolis Hastings (MH) sampling for the variance components model 46 > > # 4.2 Metropolis-Hastings settings . . . . . . . . . . . . . . . . . . . .47 > > # 4.3 Running the variance components with Metropolis Hastings . . . . . .48 > > ## MH Adaptive with defaults > (mymodel3 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, mcmcMeth = list(fixM = 2, + residM = 2, Lev1VarM = 2)), data = tutorial)) 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] 2 2 2 1 1 1 RUNNING ADAPTIVE PROCEDURE AND BURNING IN... Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9216.844644 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9193.344581 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9239.110642 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 9194.362705 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 9209.835671 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 9201.870325 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 9211.666035 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 9228.713460 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 9201.487630 Adapting for 1000 iterations (Maximum 5000) -2 * Loglike = 9214.630149 Adapting finished and took 1100 iterations Adapting took 1100 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9209.666876 Burning in for 100 iterations out of 500 -2 * Loglike = 9206.912558 Burning in for 150 iterations out of 500 -2 * Loglike = 9213.749021 Burning in for 200 iterations out of 500 -2 * Loglike = 9213.324066 Burning in for 250 iterations out of 500 -2 * Loglike = 9203.170194 Burning in for 300 iterations out of 500 -2 * Loglike = 9230.452260 Burning in for 350 iterations out of 500 -2 * Loglike = 9216.213513 Burning in for 400 iterations out of 500 -2 * Loglike = 9201.829237 Burning in for 450 iterations out of 500 -2 * Loglike = 9211.087138 Burning in for 500 iterations out of 500 -2 * Loglike = 9216.124129 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 1 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 9205.171241 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9222.181500 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9203.968250 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9221.229272 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9214.287113 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9199.220252 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9201.799320 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9215.784324 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9225.801241 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9203.603169 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9206.897351 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9230.695795 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9192.683892 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9212.753972 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9183.656270 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9209.531878 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9197.737628 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9214.084144 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9239.810827 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9221.785312 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9210.388620 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9228.431943 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9220.585103 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9201.348804 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9207.767122 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9203.233941 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9209.980034 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9210.065869 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9215.016175 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9210.590069 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9231.127153 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9198.362646 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9194.500793 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9206.200900 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9210.928375 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9207.926157 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9203.074990 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9196.455484 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9229.428031 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9209.802084 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9221.465246 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9219.779655 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9205.789880 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9213.135966 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9213.734512 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9208.256255 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9198.851182 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9198.211166 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9204.658451 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9204.373674 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9204.887622 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9214.430917 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9215.254256 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9214.810620 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9202.486425 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9226.249798 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9187.310147 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9185.707534 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9206.616737 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9213.142871 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9192.488140 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9219.601270 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9211.289449 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9198.502329 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9207.122808 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9204.487471 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9220.162508 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9207.944320 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9232.116201 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9203.473437 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9203.609752 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9207.835882 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9223.561270 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9217.226026 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9197.942160 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9201.726241 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9219.117464 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9206.283582 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9197.304016 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9206.002146 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9199.436587 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9204.046674 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9193.373709 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9186.480049 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9222.119987 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9198.039653 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9204.564222 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9215.307305 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9188.898150 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9201.413064 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9202.677921 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9214.486208 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9222.441606 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9243.059168 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9221.311090 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9202.431365 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9206.144576 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9235.130212 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9216.824432 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9230.171839 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9209.1 S.D. = 11.534 S.E.M. = 0.16311 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: MCMC Elapsed time : 1.53s Number of obs: 4059 (from total 4059) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9209.051 9149.217 59.834 9268.885 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (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 0.00057 0.04127 0.01 0.989 -0.07841 0.07812 55 standlrt 0.56334 0.01248 45.14 0 *** 0.53872 0.58814 958 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 0.09695 0.02025 0.06387 0.14442 1935 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56635 0.01269 0.54208 0.59130 4574 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > sixway(mymodel3@chains[, "FP_standlrt", drop = FALSE], "beta_1") > > ## MH Scale Factor = 5.8 > (mymodel4 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, mcmcMeth = list(fixM = 2, + residM = 2, Lev1VarM = 2, adaption = 0)), data = tutorial)) 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 0 5.8 50 10 G30[1] G30[2] 2 2 2 1 1 1 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 9171.220787 Burning in for 100 iterations out of 500 -2 * Loglike = 9219.355848 Burning in for 150 iterations out of 500 -2 * Loglike = 9194.050475 Burning in for 200 iterations out of 500 -2 * Loglike = 9207.295021 Burning in for 250 iterations out of 500 -2 * Loglike = 9206.250556 Burning in for 300 iterations out of 500 -2 * Loglike = 9203.850907 Burning in for 350 iterations out of 500 -2 * Loglike = 9211.711232 Burning in for 400 iterations out of 500 -2 * Loglike = 9206.743358 Burning in for 450 iterations out of 500 -2 * Loglike = 9179.907652 Burning in for 500 iterations out of 500 -2 * Loglike = 9199.459747 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 1 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 9208.353075 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9243.794865 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9212.610569 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9214.551254 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9208.896627 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9208.969436 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9203.531102 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9218.277218 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9197.125796 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9207.690768 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9187.296121 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9239.212546 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9218.480930 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9221.498839 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9208.793315 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9210.317744 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9210.793970 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9206.222693 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9229.883357 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9198.911074 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9200.735320 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9214.938217 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9213.526119 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9195.253089 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9213.417205 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9219.643481 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9192.423865 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9231.831345 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9222.083748 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9200.165033 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9212.516585 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9192.610205 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9222.047905 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9217.310765 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9217.683192 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9199.318229 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9204.668658 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9194.445587 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9208.505037 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9210.942651 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9200.816243 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9193.853331 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9206.930750 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9201.434960 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9193.744321 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9202.603645 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9205.232375 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9211.387810 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9224.213815 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9210.423544 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9208.686017 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9203.383342 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9215.573024 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9206.700612 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9202.771284 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9197.962133 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9203.464372 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9195.759459 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9199.886484 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9201.194762 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9197.503318 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9199.027410 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9204.989987 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9200.091843 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9208.458222 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9199.437838 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9186.950279 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9201.671521 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9211.268056 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9204.500114 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9203.497082 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9199.916901 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9191.372612 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9210.796556 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9211.011955 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9210.647308 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9219.869552 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9183.195197 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9196.037683 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9193.855707 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9203.304721 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9230.341889 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9197.360632 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9195.892610 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9218.477416 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9216.109422 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9207.208041 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9212.217772 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9205.367041 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9208.361324 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9198.375577 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9219.935017 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9213.341347 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9203.986620 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9215.347719 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9236.879273 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9220.357881 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9205.917920 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9182.847409 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9179.948428 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9209.1 S.D. = 11.755 S.E.M. = 0.16624 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: MCMC Elapsed time : 1.32s Number of obs: 4059 (from total 4059) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9209.072 9149.406 59.666 9268.738 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (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 -0.00490 0.03726 -0.13 0.8953 -0.07788 0.06390 35 standlrt 0.56326 0.01230 45.78 0 *** 0.53822 0.58709 1041 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 0.09618 0.01958 0.06419 0.13992 2097 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56630 0.01258 0.54206 0.59148 4198 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > if (!require(texreg)) { + warning("texreg package required to use screenreg() function") + } else { + screenreg(list(mymodel1, mymodel2, mymodel4, mymodel3), custom.model.names=c("IGLS", "Gibbs", "MH", "MH Adaptive"), groups = list("Fixed Part" = 1:2, "Level-2" = 3:3, "Level-1" = 4:4), + stars = numeric(0), include.nobs=FALSE, include.loglik=FALSE, include.deviance=FALSE, include.dbar=FALSE, include.dthetabar=FALSE, include.pd=FALSE, include.dic=FALSE) + } Loading required package: texreg Version: 1.39.3 Date: 2023-11-09 Author: Philip Leifeld (University of Essex) Consider submitting praise using the praise or praise_interactive functions. Please cite the JSS article in your publications -- see citation("texreg"). ========================================================================== IGLS Gibbs MH MH Adaptive -------------------------------------------------------------------------- Fixed Part FP_Intercept 0.00 0.00 -0.00 0.00 (0.04) [-0.08; 0.09] [-0.08; 0.06] [-0.08; 0.08] FP_standlrt 0.56 0.56 * 0.56 * 0.56 * (0.01) [ 0.54; 0.59] [ 0.54; 0.59] [ 0.54; 0.59] Level-2 RP2_var_Intercept 0.09 0.10 * 0.10 * 0.10 * (0.02) [ 0.06; 0.14] [ 0.06; 0.14] [ 0.06; 0.14] Level-1 RP1_var_Intercept 0.57 0.57 * 0.57 * 0.57 * (0.01) [ 0.54; 0.59] [ 0.54; 0.59] [ 0.54; 0.59] ========================================================================== * Null hypothesis value outside the confidence interval. > > rm(list = c("mymodel1", "mymodel2", "mymodel3", "mymodel4")) > # 4.4 MH cycles per Gibbs iteration . . . . . . . . . . . . . . . . . . . 49 > > # 4.5 Block updating MH sampling . . . . . . . . . . . . . . . . . . . . .49 > ## MH Adaptive with defaults > (mymodel5 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, mcmcMeth = list(fixM = 3, + residM = 2, Lev1VarM = 2, rate = 40)), data = tutorial)) 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 40 10 G30[1] G30[2] 3 2 2 1 1 1 RUNNING ADAPTIVE PROCEDURE AND BURNING IN... Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9198.961206 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9211.260898 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9197.934205 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 9224.568968 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 9219.065991 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 9225.524935 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 9211.854417 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 9197.669421 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 9187.839441 Adapting finished and took 1000 iterations Adapting took 1000 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9231.985999 Burning in for 100 iterations out of 500 -2 * Loglike = 9189.557102 Burning in for 150 iterations out of 500 -2 * Loglike = 9202.522610 Burning in for 200 iterations out of 500 -2 * Loglike = 9204.067911 Burning in for 250 iterations out of 500 -2 * Loglike = 9199.629954 Burning in for 300 iterations out of 500 -2 * Loglike = 9210.286034 Burning in for 350 iterations out of 500 -2 * Loglike = 9226.510859 Burning in for 400 iterations out of 500 -2 * Loglike = 9215.654132 Burning in for 450 iterations out of 500 -2 * Loglike = 9220.238612 Burning in for 500 iterations out of 500 -2 * Loglike = 9207.944286 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 1 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 9212.699283 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9227.233102 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9197.934686 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9191.464069 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9199.850038 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9203.130586 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9201.374689 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9221.155461 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9205.536330 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9199.331945 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9216.044493 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9196.403602 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9203.412759 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9225.453247 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9211.571409 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9203.192002 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9193.882992 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9220.468683 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9201.071592 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9199.597539 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9198.222323 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9205.299797 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9216.477610 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9206.680434 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9211.304947 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9208.584083 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9218.785921 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9210.925499 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9224.314673 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9208.506162 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9189.205560 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9229.921344 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9197.319711 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9209.887057 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9223.206953 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9214.126304 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9212.196439 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9208.486856 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9235.640654 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9216.911983 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9212.611939 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9212.690991 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9219.878790 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9221.700930 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9198.536834 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9207.199983 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9198.812871 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9198.285894 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9200.309140 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9208.737298 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9196.973891 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9208.810027 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9204.707518 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9198.883365 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9207.804500 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9208.367194 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9223.542168 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9229.674966 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9185.707945 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9193.426994 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9226.920766 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9216.106236 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9209.478676 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9204.931071 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9202.790601 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9217.531386 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9219.427798 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9212.351879 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9235.785490 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9198.686467 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9212.046825 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9201.474862 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9195.416401 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9196.588357 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9205.424228 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9216.739985 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9215.136709 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9202.803014 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9215.193087 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9189.486004 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9206.235485 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9203.446638 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9212.138871 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9213.709736 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9204.737559 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9210.323641 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9200.978442 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9189.480709 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9192.834023 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9207.254937 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9209.161382 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9214.433427 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9198.369232 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9205.302554 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9220.582815 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9193.388342 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9208.137706 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9207.769254 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9200.171391 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9233.787023 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9209.0 S.D. = 12.155 S.E.M. = 0.17189 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: MCMC Elapsed time : 1.43s Number of obs: 4059 (from total 4059) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9208.982 9148.806 60.175 9269.157 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (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 -0.00035 0.04218 -0.01 0.9934 -0.08298 0.08548 41 standlrt 0.56377 0.01239 45.50 0 *** 0.53867 0.58656 201 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 0.09795 0.02015 0.06523 0.14331 1959 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56585 0.01254 0.54188 0.59072 4663 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > estimates <- mymodel5@chains > par(mfrow = c(3, 2)) > plot(4951:nrow(estimates), estimates[4951:nrow(estimates), "deviance"], xlab = "iteration", ylab = expression(paste("Est. of deviance")), + type = "l") > plot(4951:nrow(estimates), estimates[4951:nrow(estimates), "FP_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + beta[0])), type = "l") > plot(4951:nrow(estimates), estimates[4951:nrow(estimates), "FP_standlrt"], xlab = "iteration", ylab = expression(paste("Est. of ", + beta[1])), type = "l") > plot(4951:nrow(estimates), estimates[4951:nrow(estimates), "RP2_var_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + sigma[u0]^2)), type = "l") > plot(4951:nrow(estimates), estimates[4951:nrow(estimates), "RP1_var_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + sigma[e0]^2)), type = "l") > par(mfrow = c(1, 1)) > rm(mymodel5) > > # 4.6 Residuals in MCMC . . . . . . . . . . . . . . . . . . . . . . . . . 51 > > (mymodel6 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, resi.store = TRUE, + resi.store.levs = 2, mcmcMeth = list(iterations = 5001)), data = tutorial)) 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 1 BURNING IN... Burning in for 50 iterations out of 500 -2 * Loglike = 9206.193266 Burning in for 100 iterations out of 500 -2 * Loglike = 9216.262176 Burning in for 150 iterations out of 500 -2 * Loglike = 9241.057582 Burning in for 200 iterations out of 500 -2 * Loglike = 9214.675885 Burning in for 250 iterations out of 500 -2 * Loglike = 9198.255145 Burning in for 300 iterations out of 500 -2 * Loglike = 9227.186873 Burning in for 350 iterations out of 500 -2 * Loglike = 9222.091977 Burning in for 400 iterations out of 500 -2 * Loglike = 9214.630238 Burning in for 450 iterations out of 500 -2 * Loglike = 9216.522216 Burning in for 500 iterations out of 500 -2 * Loglike = 9201.148603 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5001 1 c1090 c1091 c1003 c1004 1 1 Actual update 50 of 5001, Stored update 50 of 5001 -2 * Loglike = 9212.190791 Actual update 100 of 5001, Stored update 100 of 5001 -2 * Loglike = 9208.377297 Actual update 150 of 5001, Stored update 150 of 5001 -2 * Loglike = 9207.886882 Actual update 200 of 5001, Stored update 200 of 5001 -2 * Loglike = 9195.385976 Actual update 250 of 5001, Stored update 250 of 5001 -2 * Loglike = 9238.483062 Actual update 300 of 5001, Stored update 300 of 5001 -2 * Loglike = 9215.621742 Actual update 350 of 5001, Stored update 350 of 5001 -2 * Loglike = 9205.716499 Actual update 400 of 5001, Stored update 400 of 5001 -2 * Loglike = 9207.158850 Actual update 450 of 5001, Stored update 450 of 5001 -2 * Loglike = 9210.248427 Actual update 500 of 5001, Stored update 500 of 5001 -2 * Loglike = 9228.495732 Actual update 550 of 5001, Stored update 550 of 5001 -2 * Loglike = 9221.683303 Actual update 600 of 5001, Stored update 600 of 5001 -2 * Loglike = 9202.166694 Actual update 650 of 5001, Stored update 650 of 5001 -2 * Loglike = 9237.981658 Actual update 700 of 5001, Stored update 700 of 5001 -2 * Loglike = 9201.878383 Actual update 750 of 5001, Stored update 750 of 5001 -2 * Loglike = 9198.726654 Actual update 800 of 5001, Stored update 800 of 5001 -2 * Loglike = 9214.104227 Actual update 850 of 5001, Stored update 850 of 5001 -2 * Loglike = 9227.156460 Actual update 900 of 5001, Stored update 900 of 5001 -2 * Loglike = 9197.279082 Actual update 950 of 5001, Stored update 950 of 5001 -2 * Loglike = 9191.816267 Actual update 1000 of 5001, Stored update 1000 of 5001 -2 * Loglike = 9219.178731 Actual update 1050 of 5001, Stored update 1050 of 5001 -2 * Loglike = 9214.163387 Actual update 1100 of 5001, Stored update 1100 of 5001 -2 * Loglike = 9218.308723 Actual update 1150 of 5001, Stored update 1150 of 5001 -2 * Loglike = 9188.214048 Actual update 1200 of 5001, Stored update 1200 of 5001 -2 * Loglike = 9188.278770 Actual update 1250 of 5001, Stored update 1250 of 5001 -2 * Loglike = 9208.819913 Actual update 1300 of 5001, Stored update 1300 of 5001 -2 * Loglike = 9193.939811 Actual update 1350 of 5001, Stored update 1350 of 5001 -2 * Loglike = 9193.651680 Actual update 1400 of 5001, Stored update 1400 of 5001 -2 * Loglike = 9215.606479 Actual update 1450 of 5001, Stored update 1450 of 5001 -2 * Loglike = 9195.925780 Actual update 1500 of 5001, Stored update 1500 of 5001 -2 * Loglike = 9218.422125 Actual update 1550 of 5001, Stored update 1550 of 5001 -2 * Loglike = 9202.244183 Actual update 1600 of 5001, Stored update 1600 of 5001 -2 * Loglike = 9204.907738 Actual update 1650 of 5001, Stored update 1650 of 5001 -2 * Loglike = 9194.883902 Actual update 1700 of 5001, Stored update 1700 of 5001 -2 * Loglike = 9214.140517 Actual update 1750 of 5001, Stored update 1750 of 5001 -2 * Loglike = 9211.397609 Actual update 1800 of 5001, Stored update 1800 of 5001 -2 * Loglike = 9207.941176 Actual update 1850 of 5001, Stored update 1850 of 5001 -2 * Loglike = 9216.158993 Actual update 1900 of 5001, Stored update 1900 of 5001 -2 * Loglike = 9216.821254 Actual update 1950 of 5001, Stored update 1950 of 5001 -2 * Loglike = 9209.099646 Actual update 2000 of 5001, Stored update 2000 of 5001 -2 * Loglike = 9205.356036 Actual update 2050 of 5001, Stored update 2050 of 5001 -2 * Loglike = 9226.820798 Actual update 2100 of 5001, Stored update 2100 of 5001 -2 * Loglike = 9215.889068 Actual update 2150 of 5001, Stored update 2150 of 5001 -2 * Loglike = 9204.485567 Actual update 2200 of 5001, Stored update 2200 of 5001 -2 * Loglike = 9239.773102 Actual update 2250 of 5001, Stored update 2250 of 5001 -2 * Loglike = 9204.613020 Actual update 2300 of 5001, Stored update 2300 of 5001 -2 * Loglike = 9205.832435 Actual update 2350 of 5001, Stored update 2350 of 5001 -2 * Loglike = 9197.787494 Actual update 2400 of 5001, Stored update 2400 of 5001 -2 * Loglike = 9202.635017 Actual update 2450 of 5001, Stored update 2450 of 5001 -2 * Loglike = 9202.243753 Actual update 2500 of 5001, Stored update 2500 of 5001 -2 * Loglike = 9199.686027 Actual update 2550 of 5001, Stored update 2550 of 5001 -2 * Loglike = 9213.435702 Actual update 2600 of 5001, Stored update 2600 of 5001 -2 * Loglike = 9215.862131 Actual update 2650 of 5001, Stored update 2650 of 5001 -2 * Loglike = 9203.440604 Actual update 2700 of 5001, Stored update 2700 of 5001 -2 * Loglike = 9197.917390 Actual update 2750 of 5001, Stored update 2750 of 5001 -2 * Loglike = 9225.824248 Actual update 2800 of 5001, Stored update 2800 of 5001 -2 * Loglike = 9222.623770 Actual update 2850 of 5001, Stored update 2850 of 5001 -2 * Loglike = 9226.897380 Actual update 2900 of 5001, Stored update 2900 of 5001 -2 * Loglike = 9197.383677 Actual update 2950 of 5001, Stored update 2950 of 5001 -2 * Loglike = 9211.390320 Actual update 3000 of 5001, Stored update 3000 of 5001 -2 * Loglike = 9207.286579 Actual update 3050 of 5001, Stored update 3050 of 5001 -2 * Loglike = 9217.534200 Actual update 3100 of 5001, Stored update 3100 of 5001 -2 * Loglike = 9227.872396 Actual update 3150 of 5001, Stored update 3150 of 5001 -2 * Loglike = 9198.935844 Actual update 3200 of 5001, Stored update 3200 of 5001 -2 * Loglike = 9203.578259 Actual update 3250 of 5001, Stored update 3250 of 5001 -2 * Loglike = 9193.257434 Actual update 3300 of 5001, Stored update 3300 of 5001 -2 * Loglike = 9204.815469 Actual update 3350 of 5001, Stored update 3350 of 5001 -2 * Loglike = 9200.291358 Actual update 3400 of 5001, Stored update 3400 of 5001 -2 * Loglike = 9219.578031 Actual update 3450 of 5001, Stored update 3450 of 5001 -2 * Loglike = 9214.657834 Actual update 3500 of 5001, Stored update 3500 of 5001 -2 * Loglike = 9213.144417 Actual update 3550 of 5001, Stored update 3550 of 5001 -2 * Loglike = 9217.997575 Actual update 3600 of 5001, Stored update 3600 of 5001 -2 * Loglike = 9225.109666 Actual update 3650 of 5001, Stored update 3650 of 5001 -2 * Loglike = 9212.063094 Actual update 3700 of 5001, Stored update 3700 of 5001 -2 * Loglike = 9226.746381 Actual update 3750 of 5001, Stored update 3750 of 5001 -2 * Loglike = 9214.159422 Actual update 3800 of 5001, Stored update 3800 of 5001 -2 * Loglike = 9204.966122 Actual update 3850 of 5001, Stored update 3850 of 5001 -2 * Loglike = 9190.735716 Actual update 3900 of 5001, Stored update 3900 of 5001 -2 * Loglike = 9206.324394 Actual update 3950 of 5001, Stored update 3950 of 5001 -2 * Loglike = 9205.512200 Actual update 4000 of 5001, Stored update 4000 of 5001 -2 * Loglike = 9201.017143 Actual update 4050 of 5001, Stored update 4050 of 5001 -2 * Loglike = 9211.234780 Actual update 4100 of 5001, Stored update 4100 of 5001 -2 * Loglike = 9211.765768 Actual update 4150 of 5001, Stored update 4150 of 5001 -2 * Loglike = 9200.968089 Actual update 4200 of 5001, Stored update 4200 of 5001 -2 * Loglike = 9229.231239 Actual update 4250 of 5001, Stored update 4250 of 5001 -2 * Loglike = 9207.636298 Actual update 4300 of 5001, Stored update 4300 of 5001 -2 * Loglike = 9197.507235 Actual update 4350 of 5001, Stored update 4350 of 5001 -2 * Loglike = 9208.445006 Actual update 4400 of 5001, Stored update 4400 of 5001 -2 * Loglike = 9231.667774 Actual update 4450 of 5001, Stored update 4450 of 5001 -2 * Loglike = 9201.470719 Actual update 4500 of 5001, Stored update 4500 of 5001 -2 * Loglike = 9208.425209 Actual update 4550 of 5001, Stored update 4550 of 5001 -2 * Loglike = 9216.996959 Actual update 4600 of 5001, Stored update 4600 of 5001 -2 * Loglike = 9225.405793 Actual update 4650 of 5001, Stored update 4650 of 5001 -2 * Loglike = 9201.746288 Actual update 4700 of 5001, Stored update 4700 of 5001 -2 * Loglike = 9212.656436 Actual update 4750 of 5001, Stored update 4750 of 5001 -2 * Loglike = 9202.976127 Actual update 4800 of 5001, Stored update 4800 of 5001 -2 * Loglike = 9218.846042 Actual update 4850 of 5001, Stored update 4850 of 5001 -2 * Loglike = 9200.637551 Actual update 4900 of 5001, Stored update 4900 of 5001 -2 * Loglike = 9219.146880 Actual update 4950 of 5001, Stored update 4950 of 5001 -2 * Loglike = 9215.841845 Actual update 5000 of 5001, Stored update 5000 of 5001 -2 * Loglike = 9212.109834 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5001 Average = 9209.1 S.D. = 11.915 S.E.M. = 0.16849 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.09) multilevel model (Normal) N min mean max N_complete min_complete mean_complete max_complete school 65 2 62.44615 198 65 2 62.44615 198 Estimation algorithm: MCMC Elapsed time : 1.56s Number of obs: 4059 (from total 4059) Number of iter.: 5001 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9209.079 9149.068 60.011 9269.090 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (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 0.00316 0.04422 0.07 0.9431 -0.08335 0.09189 223 standlrt 0.56322 0.01258 44.77 0 *** 0.53844 0.58780 3822 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 0.09742 0.01988 0.06472 0.14144 3127 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56618 0.01249 0.54212 0.59090 4753 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > resi.chain2 <- mymodel6@resi.chains$resi_lev2 > sixway(resi.chain2[, 1, drop = FALSE], name = "u0_1") > > # 4.7 Comparing two schools . . . . . . . . . . . . . . . . . . . . . . . 54 > > dif <- resi.chain2[, 1] - resi.chain2[, 2] > sixway(dif, name = "dif") > prop <- (dif > 0) > mean(prop) [1] 0.1587682 > > # 4.8 Calculating ranks of schools . . . . . . . . . . . . . . . . . . . .55 > > u0rank <- apply(resi.chain2, 1, rank) > u0rankmn <- apply(u0rank, 1, mean) > u0ranklo <- apply(u0rank, 1, function(x) quantile(x, 0.025)) > u0rankmd <- apply(u0rank, 1, median) > u0rankhi <- apply(u0rank, 1, function(x) quantile(x, 0.975)) > > plot(1:65, u0rankmd, ylim = c(0.5, 65.5), pch = 15, xlab = "School", ylab = "Rank") > points(1:65, u0ranklo, pch = 24, bg = "grey") > points(1:65, u0rankhi, pch = 25, bg = "grey") > for (i in 1:65) lines(rep(i, 2), c(u0ranklo[i], u0rankhi[i])) > > ## common caterpillar plot > > rankno <- order(u0rankmn) > plot(1:65, u0rankmn[rankno], ylim = c(0.5, 65.5), pch = 15, xlab = "School", ylab = "Rank") > points(1:65, u0ranklo[rankno], pch = 24, bg = "grey") > points(1:65, u0rankhi[rankno], pch = 25, bg = "grey") > for (i in 1:65) lines(rep(i, 2), c(u0ranklo[rankno[i]], u0rankhi[rankno[i]])) > > # 4.9 Estimating a function of parameters . . . . . . . . . . . . . . . . 58 > estimates <- mymodel6@chains > isc <- estimates[, "RP2_var_Intercept"]/(estimates[, "RP2_var_Intercept"] + estimates[, "RP1_var_Intercept"]) > summary(isc) Iterations = 1:5001 Thinning interval = 1 Number of chains = 1 Sample size per chain = 5001 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE 0.1461230 0.0253555 0.0003585 0.0004551 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% 0.1024 0.1285 0.1443 0.1615 0.2002 > sixway(isc, "isc") > rm(mymodel6) > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . . 60 > > ## reinstate par settings > par(mypar) > > > ############################################################################ > > proc.time() user system elapsed 5.92 0.71 14.92