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 > # > # 21 Using Structured MCMC . . . . . . . . . . . . . . . . . . . . . . .327 > # > # 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/ > ############################################################################ > > # 21.1 SMCMC Theory . . . . . . . . . . . . . . . . . . . . . . . . . . .327 > > # 21.2 Fitting the model using MLwiN . . . . . . . . . . . . . . . . . . 330 > > 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 > > ## Read tutorial data > data(tutorial, package = "R2MLwiN") > > ## Define the model > > (mymodel <- runMLwiN(normexam ~ 1 + (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 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 for 50 iterations out of 500 -2 * Loglike = 10847.820270 Burning in for 100 iterations out of 500 -2 * Loglike = 10860.697552 Burning in for 150 iterations out of 500 -2 * Loglike = 10849.534371 Burning in for 200 iterations out of 500 -2 * Loglike = 10850.670040 Burning in for 250 iterations out of 500 -2 * Loglike = 10830.922843 Burning in for 300 iterations out of 500 -2 * Loglike = 10851.202135 Burning in for 350 iterations out of 500 -2 * Loglike = 10831.186056 Burning in for 400 iterations out of 500 -2 * Loglike = 10838.507313 Burning in for 450 iterations out of 500 -2 * Loglike = 10841.701201 Burning in for 500 iterations out of 500 -2 * Loglike = 10848.918096 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 = 10822.788614 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 10865.181513 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 10837.691070 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 10880.285861 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 10833.110430 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 10844.265345 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 10858.607350 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 10831.891795 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 10856.861249 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 10824.758762 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 10845.858542 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 10844.826830 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 10862.143643 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 10842.581836 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 10834.259843 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 10851.536666 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 10852.274906 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 10859.691363 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 10833.246570 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 10833.952931 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 10857.442861 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 10860.615023 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 10852.796682 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 10867.313991 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 10846.393868 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 10863.772440 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 10851.851137 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 10849.506033 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 10865.054268 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 10841.493048 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 10837.389773 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 10842.953887 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 10844.488177 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 10844.711989 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 10844.804713 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 10839.594112 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 10849.154572 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 10860.437248 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 10868.448213 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 10835.531579 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 10854.971270 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 10864.444900 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 10850.386079 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 10837.019473 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 10838.210265 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 10890.708656 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 10835.721477 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 10860.325960 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 10882.421342 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 10873.131199 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 10832.176706 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 10858.781475 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 10842.603451 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 10845.443216 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 10846.696437 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 10852.980567 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 10870.685600 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 10865.558939 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 10839.289750 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 10856.743050 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 10846.803279 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 10845.939962 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 10859.518286 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 10844.083664 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 10853.951421 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 10827.939256 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 10855.188332 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 10848.802296 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 10857.682950 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 10847.743737 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 10854.692642 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 10845.608599 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 10853.097920 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 10846.784688 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 10847.376478 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 10851.908312 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 10841.962641 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 10844.944032 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 10866.722823 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 10838.317977 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 10826.617080 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 10844.415737 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 10846.888156 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 10859.615806 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 10834.763065 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 10852.353281 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 10856.812512 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 10852.181962 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 10848.798576 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 10864.858735 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 10844.724386 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 10840.243623 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 10834.740697 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 10848.424253 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 10854.432505 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 10829.687734 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 10840.477795 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 10873.693521 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 10849.245570 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 10856.432891 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 10850. S.D. = 11.751 S.E.M. = 0.16618 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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.31s 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 10849.609 10789.729 59.879 10909.488 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.01474 0.05650 -0.26 0.7942 -0.12039 0.09603 172 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.17775 0.03642 0.11920 0.26236 3278 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.84847 0.01900 0.81147 0.88711 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > summary(mymodel@chains[, "FP_Intercept"]) Iterations = 1:5000 Thinning interval = 1 Number of chains = 1 Sample size per chain = 5000 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE -0.0147387 0.0565029 0.0007991 0.0043069 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% -0.12039 -0.05365 -0.01626 0.02304 0.09603 > sixway(mymodel@chains[, "FP_Intercept", drop = FALSE], "beta_0") > > ## Structured MCMC > > (mymodel <- runMLwiN(normexam ~ 1 + (1 | school) + (1 | student), estoptions = list(EstM = 1, mcmcOptions = list(smcm = 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 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 for 50 iterations out of 500 -2 * Loglike = 10844.140504 Burning in for 100 iterations out of 500 -2 * Loglike = 10839.614592 Burning in for 150 iterations out of 500 -2 * Loglike = 10868.760776 Burning in for 200 iterations out of 500 -2 * Loglike = 10851.778850 Burning in for 250 iterations out of 500 -2 * Loglike = 10845.479914 Burning in for 300 iterations out of 500 -2 * Loglike = 10863.688850 Burning in for 350 iterations out of 500 -2 * Loglike = 10855.195740 Burning in for 400 iterations out of 500 -2 * Loglike = 10861.089527 Burning in for 450 iterations out of 500 -2 * Loglike = 10848.340749 Burning in for 500 iterations out of 500 -2 * Loglike = 10841.401679 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 = 10834.647773 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 10849.782421 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 10855.072182 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 10839.848338 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 10851.358798 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 10878.396305 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 10846.009136 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 10839.807557 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 10862.444375 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 10862.135654 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 10858.212213 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 10833.510224 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 10836.058101 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 10850.050916 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 10837.829543 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 10846.482598 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 10856.365852 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 10852.357090 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 10832.103488 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 10852.486901 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 10824.657345 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 10838.392257 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 10854.019201 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 10858.547646 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 10856.180143 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 10859.291436 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 10850.794104 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 10857.271993 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 10843.840589 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 10870.146749 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 10867.168265 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 10865.033401 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 10855.282112 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 10847.989019 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 10852.056905 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 10865.314419 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 10860.137335 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 10841.146911 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 10829.817078 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 10867.388058 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 10857.261101 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 10834.443001 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 10833.216244 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 10841.392872 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 10849.613899 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 10865.418229 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 10857.863383 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 10859.287571 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 10855.236434 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 10826.209519 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 10836.083946 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 10876.052358 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 10829.645401 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 10860.532566 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 10857.200261 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 10851.551523 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 10863.118859 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 10845.316817 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 10857.466067 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 10836.079296 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 10859.163715 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 10838.910086 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 10837.096514 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 10851.788238 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 10846.735938 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 10848.466900 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 10851.592178 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 10838.477154 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 10843.735865 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 10848.604023 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 10846.699689 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 10858.061429 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 10829.794589 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 10851.413161 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 10838.260193 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 10875.866386 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 10848.281594 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 10853.746178 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 10845.220791 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 10822.378418 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 10847.434511 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 10848.412969 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 10832.243464 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 10839.384061 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 10842.772597 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 10837.047220 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 10852.442825 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 10865.544566 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 10869.670666 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 10831.810224 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 10856.903639 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 10840.407254 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 10847.042569 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 10837.600048 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 10830.121380 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 10870.246045 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 10841.998514 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 10847.829068 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 10837.463931 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 10862.218803 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 10850. S.D. = 11.642 S.E.M. = 0.16464 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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.89s 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 10849.649 10789.843 59.806 10909.455 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + (1 | school) + (1 | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.01326 0.05504 -0.24 0.8096 -0.12203 0.09694 5000 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.17720 0.03577 0.11912 0.26015 3399 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.84820 0.01900 0.81129 0.88501 4574 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > summary(mymodel@chains[, "FP_Intercept"]) Iterations = 1:5000 Thinning interval = 1 Number of chains = 1 Sample size per chain = 5000 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE -0.0132592 0.0550399 0.0007784 0.0007784 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% -0.12203 -0.04894 -0.01336 0.02208 0.09694 > sixway(mymodel@chains[, "FP_Intercept", drop = FALSE], "beta_0") > > # 21.3 A random intercepts model . . . . . . . . . . . . . . . . . . . . 334 > > (mymodel <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, mcmcOptions = list(smcm = 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 for 50 iterations out of 500 -2 * Loglike = 9200.709700 Burning in for 100 iterations out of 500 -2 * Loglike = 9201.435737 Burning in for 150 iterations out of 500 -2 * Loglike = 9209.262379 Burning in for 200 iterations out of 500 -2 * Loglike = 9209.226410 Burning in for 250 iterations out of 500 -2 * Loglike = 9206.491463 Burning in for 300 iterations out of 500 -2 * Loglike = 9208.492028 Burning in for 350 iterations out of 500 -2 * Loglike = 9209.635411 Burning in for 400 iterations out of 500 -2 * Loglike = 9210.443709 Burning in for 450 iterations out of 500 -2 * Loglike = 9235.721253 Burning in for 500 iterations out of 500 -2 * Loglike = 9203.839599 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 = 9230.332549 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9202.341831 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9232.953634 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9215.606536 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9208.176270 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9218.484728 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9219.124827 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9198.457795 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9209.506110 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9192.683097 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9209.708961 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9224.596985 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9249.224240 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9188.090515 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9208.281629 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9217.868590 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9224.766120 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9204.701012 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9223.380787 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9206.882543 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9213.963221 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9211.473028 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9214.147432 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9195.994075 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9190.030516 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9220.520423 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9215.829728 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9225.875679 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9206.247760 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9233.564768 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9202.626280 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9207.437502 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9213.058495 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9197.621676 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9186.292236 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9197.477940 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9209.525959 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9186.879900 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9203.214335 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9191.904673 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9216.848175 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9220.738003 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9194.424145 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9242.598093 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9229.582570 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9204.395010 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9219.687213 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9205.258652 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9232.778476 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9227.551018 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9219.618475 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9226.394056 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9204.207297 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9199.645637 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9195.691836 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9202.292002 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9225.527835 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9201.874058 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9224.988804 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9240.038427 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9220.056620 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9213.839309 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9220.803399 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9202.668798 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9196.566125 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9225.443709 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9186.522076 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9217.861308 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9202.261338 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9205.562007 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9219.727788 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9198.388846 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9246.979029 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9194.679872 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9216.034785 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9231.797241 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9217.960398 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9227.059506 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9211.872387 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9230.500703 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9228.345856 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9216.840453 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9224.178411 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9219.965704 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9209.807301 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9206.488689 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9208.714671 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9216.697776 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9205.877082 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9193.365786 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9189.222370 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9212.293205 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9209.165921 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9216.354484 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9216.972597 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9206.307658 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9194.518261 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9219.047699 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9207.300055 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9207.704573 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9208.9 S.D. = 11.773 S.E.M. = 0.16650 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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.64s 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.861 9149.139 59.722 9268.583 --------------------------------------------------------------------------------------------------- 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.00344 0.04122 0.08 0.9336 -0.07884 0.08547 4919 standlrt 0.56373 0.01246 45.25 0 *** 0.53935 0.58816 5000 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.09722 0.02047 0.06398 0.14410 3191 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56607 0.01268 0.54237 0.59158 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > trajectories(mymodel, Range = c(1, 500)) > > # 21.4 Examining the residual chains . . . . . . . . . . . . . . . . . . 335 > > (mymodel <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1, resi.store = TRUE, + resi.store.levs = 2, mcmcMeth = list(iterations = 5001), mcmcOptions = list(smcm = 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 for 50 iterations out of 500 -2 * Loglike = 9200.709700 Burning in for 100 iterations out of 500 -2 * Loglike = 9201.435737 Burning in for 150 iterations out of 500 -2 * Loglike = 9209.262379 Burning in for 200 iterations out of 500 -2 * Loglike = 9209.226410 Burning in for 250 iterations out of 500 -2 * Loglike = 9206.491463 Burning in for 300 iterations out of 500 -2 * Loglike = 9208.492028 Burning in for 350 iterations out of 500 -2 * Loglike = 9209.635411 Burning in for 400 iterations out of 500 -2 * Loglike = 9210.443709 Burning in for 450 iterations out of 500 -2 * Loglike = 9235.721253 Burning in for 500 iterations out of 500 -2 * Loglike = 9203.839599 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 = 9230.332549 Actual update 100 of 5001, Stored update 100 of 5001 -2 * Loglike = 9202.341831 Actual update 150 of 5001, Stored update 150 of 5001 -2 * Loglike = 9232.953634 Actual update 200 of 5001, Stored update 200 of 5001 -2 * Loglike = 9215.606536 Actual update 250 of 5001, Stored update 250 of 5001 -2 * Loglike = 9208.176270 Actual update 300 of 5001, Stored update 300 of 5001 -2 * Loglike = 9218.484728 Actual update 350 of 5001, Stored update 350 of 5001 -2 * Loglike = 9219.124827 Actual update 400 of 5001, Stored update 400 of 5001 -2 * Loglike = 9198.457795 Actual update 450 of 5001, Stored update 450 of 5001 -2 * Loglike = 9209.506110 Actual update 500 of 5001, Stored update 500 of 5001 -2 * Loglike = 9192.683097 Actual update 550 of 5001, Stored update 550 of 5001 -2 * Loglike = 9209.708961 Actual update 600 of 5001, Stored update 600 of 5001 -2 * Loglike = 9224.596985 Actual update 650 of 5001, Stored update 650 of 5001 -2 * Loglike = 9249.224240 Actual update 700 of 5001, Stored update 700 of 5001 -2 * Loglike = 9188.090515 Actual update 750 of 5001, Stored update 750 of 5001 -2 * Loglike = 9208.281629 Actual update 800 of 5001, Stored update 800 of 5001 -2 * Loglike = 9217.868590 Actual update 850 of 5001, Stored update 850 of 5001 -2 * Loglike = 9224.766120 Actual update 900 of 5001, Stored update 900 of 5001 -2 * Loglike = 9204.701012 Actual update 950 of 5001, Stored update 950 of 5001 -2 * Loglike = 9223.380787 Actual update 1000 of 5001, Stored update 1000 of 5001 -2 * Loglike = 9206.882543 Actual update 1050 of 5001, Stored update 1050 of 5001 -2 * Loglike = 9213.963221 Actual update 1100 of 5001, Stored update 1100 of 5001 -2 * Loglike = 9211.473028 Actual update 1150 of 5001, Stored update 1150 of 5001 -2 * Loglike = 9214.147432 Actual update 1200 of 5001, Stored update 1200 of 5001 -2 * Loglike = 9195.994075 Actual update 1250 of 5001, Stored update 1250 of 5001 -2 * Loglike = 9190.030516 Actual update 1300 of 5001, Stored update 1300 of 5001 -2 * Loglike = 9220.520423 Actual update 1350 of 5001, Stored update 1350 of 5001 -2 * Loglike = 9215.829728 Actual update 1400 of 5001, Stored update 1400 of 5001 -2 * Loglike = 9225.875679 Actual update 1450 of 5001, Stored update 1450 of 5001 -2 * Loglike = 9206.247760 Actual update 1500 of 5001, Stored update 1500 of 5001 -2 * Loglike = 9233.564768 Actual update 1550 of 5001, Stored update 1550 of 5001 -2 * Loglike = 9202.626280 Actual update 1600 of 5001, Stored update 1600 of 5001 -2 * Loglike = 9207.437502 Actual update 1650 of 5001, Stored update 1650 of 5001 -2 * Loglike = 9213.058495 Actual update 1700 of 5001, Stored update 1700 of 5001 -2 * Loglike = 9197.621676 Actual update 1750 of 5001, Stored update 1750 of 5001 -2 * Loglike = 9186.292236 Actual update 1800 of 5001, Stored update 1800 of 5001 -2 * Loglike = 9197.477940 Actual update 1850 of 5001, Stored update 1850 of 5001 -2 * Loglike = 9209.525959 Actual update 1900 of 5001, Stored update 1900 of 5001 -2 * Loglike = 9186.879900 Actual update 1950 of 5001, Stored update 1950 of 5001 -2 * Loglike = 9203.214335 Actual update 2000 of 5001, Stored update 2000 of 5001 -2 * Loglike = 9191.904673 Actual update 2050 of 5001, Stored update 2050 of 5001 -2 * Loglike = 9216.848175 Actual update 2100 of 5001, Stored update 2100 of 5001 -2 * Loglike = 9220.738003 Actual update 2150 of 5001, Stored update 2150 of 5001 -2 * Loglike = 9194.424145 Actual update 2200 of 5001, Stored update 2200 of 5001 -2 * Loglike = 9242.598093 Actual update 2250 of 5001, Stored update 2250 of 5001 -2 * Loglike = 9229.582570 Actual update 2300 of 5001, Stored update 2300 of 5001 -2 * Loglike = 9204.395010 Actual update 2350 of 5001, Stored update 2350 of 5001 -2 * Loglike = 9219.687213 Actual update 2400 of 5001, Stored update 2400 of 5001 -2 * Loglike = 9205.258652 Actual update 2450 of 5001, Stored update 2450 of 5001 -2 * Loglike = 9232.778476 Actual update 2500 of 5001, Stored update 2500 of 5001 -2 * Loglike = 9227.551018 Actual update 2550 of 5001, Stored update 2550 of 5001 -2 * Loglike = 9219.618475 Actual update 2600 of 5001, Stored update 2600 of 5001 -2 * Loglike = 9226.394056 Actual update 2650 of 5001, Stored update 2650 of 5001 -2 * Loglike = 9204.207297 Actual update 2700 of 5001, Stored update 2700 of 5001 -2 * Loglike = 9199.645637 Actual update 2750 of 5001, Stored update 2750 of 5001 -2 * Loglike = 9195.691836 Actual update 2800 of 5001, Stored update 2800 of 5001 -2 * Loglike = 9202.292002 Actual update 2850 of 5001, Stored update 2850 of 5001 -2 * Loglike = 9225.527835 Actual update 2900 of 5001, Stored update 2900 of 5001 -2 * Loglike = 9201.874058 Actual update 2950 of 5001, Stored update 2950 of 5001 -2 * Loglike = 9224.988804 Actual update 3000 of 5001, Stored update 3000 of 5001 -2 * Loglike = 9240.038427 Actual update 3050 of 5001, Stored update 3050 of 5001 -2 * Loglike = 9220.056620 Actual update 3100 of 5001, Stored update 3100 of 5001 -2 * Loglike = 9213.839309 Actual update 3150 of 5001, Stored update 3150 of 5001 -2 * Loglike = 9220.803399 Actual update 3200 of 5001, Stored update 3200 of 5001 -2 * Loglike = 9202.668798 Actual update 3250 of 5001, Stored update 3250 of 5001 -2 * Loglike = 9196.566125 Actual update 3300 of 5001, Stored update 3300 of 5001 -2 * Loglike = 9225.443709 Actual update 3350 of 5001, Stored update 3350 of 5001 -2 * Loglike = 9186.522076 Actual update 3400 of 5001, Stored update 3400 of 5001 -2 * Loglike = 9217.861308 Actual update 3450 of 5001, Stored update 3450 of 5001 -2 * Loglike = 9202.261338 Actual update 3500 of 5001, Stored update 3500 of 5001 -2 * Loglike = 9205.562007 Actual update 3550 of 5001, Stored update 3550 of 5001 -2 * Loglike = 9219.727788 Actual update 3600 of 5001, Stored update 3600 of 5001 -2 * Loglike = 9198.388846 Actual update 3650 of 5001, Stored update 3650 of 5001 -2 * Loglike = 9246.979029 Actual update 3700 of 5001, Stored update 3700 of 5001 -2 * Loglike = 9194.679872 Actual update 3750 of 5001, Stored update 3750 of 5001 -2 * Loglike = 9216.034785 Actual update 3800 of 5001, Stored update 3800 of 5001 -2 * Loglike = 9231.797241 Actual update 3850 of 5001, Stored update 3850 of 5001 -2 * Loglike = 9217.960398 Actual update 3900 of 5001, Stored update 3900 of 5001 -2 * Loglike = 9227.059506 Actual update 3950 of 5001, Stored update 3950 of 5001 -2 * Loglike = 9211.872387 Actual update 4000 of 5001, Stored update 4000 of 5001 -2 * Loglike = 9230.500703 Actual update 4050 of 5001, Stored update 4050 of 5001 -2 * Loglike = 9228.345856 Actual update 4100 of 5001, Stored update 4100 of 5001 -2 * Loglike = 9216.840453 Actual update 4150 of 5001, Stored update 4150 of 5001 -2 * Loglike = 9224.178411 Actual update 4200 of 5001, Stored update 4200 of 5001 -2 * Loglike = 9219.965704 Actual update 4250 of 5001, Stored update 4250 of 5001 -2 * Loglike = 9209.807301 Actual update 4300 of 5001, Stored update 4300 of 5001 -2 * Loglike = 9206.488689 Actual update 4350 of 5001, Stored update 4350 of 5001 -2 * Loglike = 9208.714671 Actual update 4400 of 5001, Stored update 4400 of 5001 -2 * Loglike = 9216.697776 Actual update 4450 of 5001, Stored update 4450 of 5001 -2 * Loglike = 9205.877082 Actual update 4500 of 5001, Stored update 4500 of 5001 -2 * Loglike = 9193.365786 Actual update 4550 of 5001, Stored update 4550 of 5001 -2 * Loglike = 9189.222370 Actual update 4600 of 5001, Stored update 4600 of 5001 -2 * Loglike = 9212.293205 Actual update 4650 of 5001, Stored update 4650 of 5001 -2 * Loglike = 9209.165921 Actual update 4700 of 5001, Stored update 4700 of 5001 -2 * Loglike = 9216.354484 Actual update 4750 of 5001, Stored update 4750 of 5001 -2 * Loglike = 9216.972597 Actual update 4800 of 5001, Stored update 4800 of 5001 -2 * Loglike = 9206.307658 Actual update 4850 of 5001, Stored update 4850 of 5001 -2 * Loglike = 9194.518261 Actual update 4900 of 5001, Stored update 4900 of 5001 -2 * Loglike = 9219.047699 Actual update 4950 of 5001, Stored update 4950 of 5001 -2 * Loglike = 9207.300055 Actual update 5000 of 5001, Stored update 5000 of 5001 -2 * Loglike = 9207.704573 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5001 Average = 9208.9 S.D. = 11.772 S.E.M. = 0.16647 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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.66s 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 9208.860 9149.136 59.723 9268.583 --------------------------------------------------------------------------------------------------- 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.00342 0.04123 0.08 0.9339 -0.07884 0.08547 4918 standlrt 0.56373 0.01246 45.24 0 *** 0.53935 0.58816 5001 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.09722 0.02047 0.06398 0.14410 3191 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56607 0.01268 0.54237 0.59158 5001 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > ## Each row represents each iteration > sixway(mymodel@resi.chains$resi_lev2[, 1, drop = FALSE], name = "school1") > > # 21.5 Random slopes model theory . . . . . . . . . . . . . . . . . . . .336 > > # 21.6 Random Slopes model practice . . . . . . . . . . . . . . . . . . .338 > > (mymodel <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 | student), estoptions = list(EstM = 1, + mcmcOptions = list(smcm = 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 for 50 iterations out of 500 -2 * Loglike = 9147.254957 Burning in for 100 iterations out of 500 -2 * Loglike = 9131.085307 Burning in for 150 iterations out of 500 -2 * Loglike = 9112.959473 Burning in for 200 iterations out of 500 -2 * Loglike = 9110.185562 Burning in for 250 iterations out of 500 -2 * Loglike = 9140.348013 Burning in for 300 iterations out of 500 -2 * Loglike = 9126.069190 Burning in for 350 iterations out of 500 -2 * Loglike = 9150.596366 Burning in for 400 iterations out of 500 -2 * Loglike = 9133.609972 Burning in for 450 iterations out of 500 -2 * Loglike = 9128.009235 Burning in for 500 iterations out of 500 -2 * Loglike = 9094.028338 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 = 9135.169408 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9091.747811 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9112.505056 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9130.422307 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9115.438497 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9122.603743 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9130.367014 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9092.720518 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9117.910533 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9097.478488 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9089.919821 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9152.754370 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9118.770365 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9136.816731 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9123.390803 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9124.325210 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9122.517715 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9118.712301 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9144.955200 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9089.736538 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9105.551620 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9127.735175 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9115.763014 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9106.666455 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9133.610844 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9123.742237 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9142.423260 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9100.453558 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9114.718575 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9126.031675 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9127.175741 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9112.597591 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9108.320336 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9099.662105 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9111.140705 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9134.782123 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9131.098416 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9117.381684 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9093.010335 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9120.826025 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9097.698382 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9135.533244 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9137.725201 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9112.277471 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9115.434784 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9123.807802 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9133.363481 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9114.896695 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9121.182473 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9107.458633 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9092.121500 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9113.322180 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9116.998871 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9108.630301 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9109.516831 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9130.577100 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9138.709846 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9094.726746 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9148.159216 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9089.669751 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9123.741593 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9100.207110 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9140.011471 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9136.451157 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9131.926515 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9133.975393 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9155.406297 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9112.990139 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9130.468038 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9116.808448 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9099.662182 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9095.225451 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9131.414614 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9113.076299 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9117.359291 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9139.480193 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9106.107020 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9107.954377 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9119.224538 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9094.899831 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9136.102977 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9100.204086 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9115.546834 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9122.029931 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9129.570818 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9147.938828 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9133.775820 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9150.019065 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9130.623068 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9127.267946 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9108.442699 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9127.267792 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9098.250977 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9103.394963 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9083.118746 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9111.277330 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9125.208655 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9118.975873 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9119.843440 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9131.420783 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9122.7 S.D. = 16.917 S.E.M. = 0.23924 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) 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 : 4.94s 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 9122.698 9031.139 91.558 9214.256 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (1 + standlrt | 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.01108 0.04046 -0.27 0.7841 -0.09128 0.06959 5000 standlrt 0.55763 0.02037 27.38 5.002e-165 *** 0.51743 0.59745 5000 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.09711 0.02008 0.06517 0.14379 3146 cov_Intercept_standlrt 0.01951 0.00740 0.00643 0.03597 1654 var_standlrt 0.01549 0.00486 0.00791 0.02695 1003 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.55432 0.01247 0.53024 0.57954 4585 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > sixway(mymodel@chains[, "FP_Intercept", drop = FALSE], "beta_0") > sixway(mymodel@chains[, "FP_standlrt", drop = FALSE], "beta_1") > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . .340 > > > > > > ############################################################################ > > proc.time() user system elapsed 5.39 0.54 18.54