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 > # > # 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-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) > > # 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... Burning in for 50 iterations out of 500 -2 * Loglike = 10847.820210 Burning in for 100 iterations out of 500 -2 * Loglike = 10860.697492 Burning in for 150 iterations out of 500 -2 * Loglike = 10849.534312 Burning in for 200 iterations out of 500 -2 * Loglike = 10850.669980 Burning in for 250 iterations out of 500 -2 * Loglike = 10830.922783 Burning in for 300 iterations out of 500 -2 * Loglike = 10851.202075 Burning in for 350 iterations out of 500 -2 * Loglike = 10831.185996 Burning in for 400 iterations out of 500 -2 * Loglike = 10838.507253 Burning in for 450 iterations out of 500 -2 * Loglike = 10841.701141 Burning in for 500 iterations out of 500 -2 * Loglike = 10848.918036 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.788554 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 10865.181453 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 10837.691010 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 10880.285801 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 10833.110370 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 10844.265285 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 10858.607291 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 10831.891735 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 10856.861189 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 10824.758702 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 10845.858482 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 10844.826770 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 10862.143583 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 10842.581776 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 10834.259783 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 10851.536606 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 10852.274846 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 10859.691303 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 10833.246510 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 10833.952872 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 10857.442801 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 10860.614963 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 10852.796622 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 10867.313931 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 10846.393808 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 10863.772380 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 10851.851077 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 10849.505973 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 10865.054208 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 10841.492988 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 10837.389713 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 10842.953827 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 10844.488117 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 10844.711929 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 10844.804653 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 10839.594052 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 10849.154512 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 10860.437188 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 10868.448153 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 10835.531519 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 10854.971210 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 10864.444840 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 10850.386020 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 10837.019413 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 10838.210205 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 10890.708596 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 10835.721417 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 10860.325900 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 10882.421282 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 10873.131139 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 10832.176646 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 10858.781415 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 10842.603391 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 10845.443157 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 10846.696377 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 10852.980508 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 10870.685540 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 10865.558879 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 10839.289690 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 10856.742990 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 10846.803219 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 10845.939902 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 10859.518226 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 10844.083604 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 10853.951361 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 10827.939196 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 10855.188273 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 10848.802236 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 10857.682890 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 10847.743677 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 10854.692582 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 10845.608539 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 10853.097860 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 10846.784628 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 10847.376418 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 10851.908252 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 10841.962581 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 10844.943972 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 10866.722763 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 10838.317917 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 10826.617020 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 10844.415677 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 10846.888096 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 10859.615746 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 10834.763005 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 10852.353221 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 10856.812452 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 10852.181902 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 10848.798516 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 10864.858675 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 10844.724326 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 10840.243563 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 10834.740637 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 10848.424193 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 10854.432445 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 10829.687675 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 10840.477735 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 10873.693461 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 10849.245510 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 10856.432831 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.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.47s 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... Burning in for 50 iterations out of 500 -2 * Loglike = 10846.295321 Burning in for 100 iterations out of 500 -2 * Loglike = 10860.379221 Burning in for 150 iterations out of 500 -2 * Loglike = 10849.588642 Burning in for 200 iterations out of 500 -2 * Loglike = 10850.464133 Burning in for 250 iterations out of 500 -2 * Loglike = 10830.858040 Burning in for 300 iterations out of 500 -2 * Loglike = 10852.885629 Burning in for 350 iterations out of 500 -2 * Loglike = 10834.859913 Burning in for 400 iterations out of 500 -2 * Loglike = 10838.352594 Burning in for 450 iterations out of 500 -2 * Loglike = 10839.875588 Burning in for 500 iterations out of 500 -2 * Loglike = 10854.191754 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.572693 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 10865.497519 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 10838.306110 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 10883.795012 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 10833.261755 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 10843.668564 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 10855.624497 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 10831.155915 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 10854.407844 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 10825.789319 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 10844.874034 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 10844.561099 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 10860.527696 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 10842.367445 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 10833.371851 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 10851.027208 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 10851.963438 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 10862.670772 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 10830.413146 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 10834.431100 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 10857.782589 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 10861.355664 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 10857.388683 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 10866.606557 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 10846.323795 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 10863.265527 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 10850.346927 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 10847.032594 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 10865.748127 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 10841.573071 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 10836.705449 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 10844.029745 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 10844.669835 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 10843.617847 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 10844.604218 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 10839.878437 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 10849.401716 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 10858.696833 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 10860.452052 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 10836.608173 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 10856.052439 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 10861.403598 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 10850.120764 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 10837.219749 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 10839.251498 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 10891.662616 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 10838.551339 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 10855.290253 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 10881.943962 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 10874.286981 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 10832.260682 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 10856.219130 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 10842.149778 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 10845.720817 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 10845.539342 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 10852.966204 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 10866.425504 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 10866.899000 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 10837.449136 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 10855.378566 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 10846.571765 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 10847.298293 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 10859.741882 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 10843.632220 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 10853.809195 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 10826.622663 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 10856.034477 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 10847.483796 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 10857.910324 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 10846.251613 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 10853.350314 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 10844.732607 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 10852.691975 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 10846.689988 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 10847.806553 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 10852.167452 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 10847.223032 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 10846.164487 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 10866.779677 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 10838.259173 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 10826.983427 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 10845.639654 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 10847.402900 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 10859.970568 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 10834.765693 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 10852.678796 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 10853.283954 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 10853.292283 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 10848.998606 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 10863.897382 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 10842.826785 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 10843.171736 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 10834.370032 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 10848.742877 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 10854.111023 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 10831.637137 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 10843.526473 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 10871.263474 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 10849.493845 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 10857.388428 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 10850. S.D. = 11.786 S.E.M. = 0.16668 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.45s 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.595 10789.744 59.852 10909.447 --------------------------------------------------------------------------------------------------- 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.01358 0.05524 -0.25 0.8057 -0.12344 0.09240 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.17760 0.03647 0.11872 0.26161 3230 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.84847 0.01900 0.81140 0.88702 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.0135842 0.0552376 0.0007812 0.0007812 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% -0.12344 -0.05053 -0.01334 0.02357 0.09240 > 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... Burning in for 50 iterations out of 500 -2 * Loglike = 9204.819343 Burning in for 100 iterations out of 500 -2 * Loglike = 9215.929214 Burning in for 150 iterations out of 500 -2 * Loglike = 9240.880687 Burning in for 200 iterations out of 500 -2 * Loglike = 9215.087010 Burning in for 250 iterations out of 500 -2 * Loglike = 9200.144970 Burning in for 300 iterations out of 500 -2 * Loglike = 9229.011288 Burning in for 350 iterations out of 500 -2 * Loglike = 9221.762675 Burning in for 400 iterations out of 500 -2 * Loglike = 9214.135739 Burning in for 450 iterations out of 500 -2 * Loglike = 9219.335854 Burning in for 500 iterations out of 500 -2 * Loglike = 9199.853827 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 = 9215.053001 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9207.418846 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9207.892983 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9195.344750 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9237.241877 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9212.959420 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9206.768823 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9208.305697 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9210.226717 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9227.563551 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9221.677434 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9201.554490 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9240.698558 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9201.888360 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9205.299616 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9213.540135 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9226.162043 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9197.191623 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9188.967136 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9221.158009 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9215.374325 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9212.308688 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9188.095863 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9187.357905 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9205.502792 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9194.510537 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9191.230641 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9214.792811 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9193.897434 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9215.890352 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9203.979844 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9206.107714 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9194.561955 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9218.290864 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9212.337310 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9207.822603 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9214.504311 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9219.289206 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9208.169647 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9206.581718 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9229.293564 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9216.656842 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9206.921298 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9239.847062 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9202.931462 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9206.190786 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9200.412806 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9204.521730 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9205.833107 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9200.467965 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9212.759563 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9213.235164 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9201.261485 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9197.980073 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9224.924066 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9221.766988 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9228.977500 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9198.894289 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9212.170523 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9205.314507 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9219.004588 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9227.886567 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9198.939036 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9205.154008 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9191.719281 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9203.249538 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9206.230987 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9219.216064 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9214.342006 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9213.938460 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9217.957717 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9224.831542 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9211.965247 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9228.784992 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9215.152268 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9204.731936 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9191.901860 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9204.385270 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9205.165691 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9195.282462 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9210.926728 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9212.213805 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9200.747242 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9223.742589 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9207.001007 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9197.283292 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9207.752775 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9233.339087 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9203.351501 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9212.950072 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9217.619530 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9224.858375 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9201.336371 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9210.620397 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9203.418573 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9218.744669 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9197.902249 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9219.156737 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9215.985241 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9218.578744 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9209.1 S.D. = 11.911 S.E.M. = 0.16844 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.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 9209.124 9149.119 60.005 9269.129 --------------------------------------------------------------------------------------------------- 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.00232 0.04035 0.06 0.9541 -0.07769 0.08336 5000 standlrt 0.56324 0.01258 44.79 0 *** 0.53857 0.58783 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.09707 0.01982 0.06484 0.14169 3140 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56618 0.01248 0.54208 0.59093 4748 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > 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... Burning in for 50 iterations out of 500 -2 * Loglike = 9204.819343 Burning in for 100 iterations out of 500 -2 * Loglike = 9215.929214 Burning in for 150 iterations out of 500 -2 * Loglike = 9240.880687 Burning in for 200 iterations out of 500 -2 * Loglike = 9215.087010 Burning in for 250 iterations out of 500 -2 * Loglike = 9200.144970 Burning in for 300 iterations out of 500 -2 * Loglike = 9229.011288 Burning in for 350 iterations out of 500 -2 * Loglike = 9221.762675 Burning in for 400 iterations out of 500 -2 * Loglike = 9214.135739 Burning in for 450 iterations out of 500 -2 * Loglike = 9219.335854 Burning in for 500 iterations out of 500 -2 * Loglike = 9199.853827 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 = 9215.053001 Actual update 100 of 5001, Stored update 100 of 5001 -2 * Loglike = 9207.418846 Actual update 150 of 5001, Stored update 150 of 5001 -2 * Loglike = 9207.892983 Actual update 200 of 5001, Stored update 200 of 5001 -2 * Loglike = 9195.344750 Actual update 250 of 5001, Stored update 250 of 5001 -2 * Loglike = 9237.241877 Actual update 300 of 5001, Stored update 300 of 5001 -2 * Loglike = 9212.959420 Actual update 350 of 5001, Stored update 350 of 5001 -2 * Loglike = 9206.768823 Actual update 400 of 5001, Stored update 400 of 5001 -2 * Loglike = 9208.305697 Actual update 450 of 5001, Stored update 450 of 5001 -2 * Loglike = 9210.226717 Actual update 500 of 5001, Stored update 500 of 5001 -2 * Loglike = 9227.563551 Actual update 550 of 5001, Stored update 550 of 5001 -2 * Loglike = 9221.677434 Actual update 600 of 5001, Stored update 600 of 5001 -2 * Loglike = 9201.554490 Actual update 650 of 5001, Stored update 650 of 5001 -2 * Loglike = 9240.698558 Actual update 700 of 5001, Stored update 700 of 5001 -2 * Loglike = 9201.888360 Actual update 750 of 5001, Stored update 750 of 5001 -2 * Loglike = 9205.299616 Actual update 800 of 5001, Stored update 800 of 5001 -2 * Loglike = 9213.540135 Actual update 850 of 5001, Stored update 850 of 5001 -2 * Loglike = 9226.162043 Actual update 900 of 5001, Stored update 900 of 5001 -2 * Loglike = 9197.191623 Actual update 950 of 5001, Stored update 950 of 5001 -2 * Loglike = 9188.967136 Actual update 1000 of 5001, Stored update 1000 of 5001 -2 * Loglike = 9221.158009 Actual update 1050 of 5001, Stored update 1050 of 5001 -2 * Loglike = 9215.374325 Actual update 1100 of 5001, Stored update 1100 of 5001 -2 * Loglike = 9212.308688 Actual update 1150 of 5001, Stored update 1150 of 5001 -2 * Loglike = 9188.095863 Actual update 1200 of 5001, Stored update 1200 of 5001 -2 * Loglike = 9187.357905 Actual update 1250 of 5001, Stored update 1250 of 5001 -2 * Loglike = 9205.502792 Actual update 1300 of 5001, Stored update 1300 of 5001 -2 * Loglike = 9194.510537 Actual update 1350 of 5001, Stored update 1350 of 5001 -2 * Loglike = 9191.230641 Actual update 1400 of 5001, Stored update 1400 of 5001 -2 * Loglike = 9214.792811 Actual update 1450 of 5001, Stored update 1450 of 5001 -2 * Loglike = 9193.897434 Actual update 1500 of 5001, Stored update 1500 of 5001 -2 * Loglike = 9215.890352 Actual update 1550 of 5001, Stored update 1550 of 5001 -2 * Loglike = 9203.979844 Actual update 1600 of 5001, Stored update 1600 of 5001 -2 * Loglike = 9206.107714 Actual update 1650 of 5001, Stored update 1650 of 5001 -2 * Loglike = 9194.561955 Actual update 1700 of 5001, Stored update 1700 of 5001 -2 * Loglike = 9218.290864 Actual update 1750 of 5001, Stored update 1750 of 5001 -2 * Loglike = 9212.337310 Actual update 1800 of 5001, Stored update 1800 of 5001 -2 * Loglike = 9207.822603 Actual update 1850 of 5001, Stored update 1850 of 5001 -2 * Loglike = 9214.504311 Actual update 1900 of 5001, Stored update 1900 of 5001 -2 * Loglike = 9219.289206 Actual update 1950 of 5001, Stored update 1950 of 5001 -2 * Loglike = 9208.169647 Actual update 2000 of 5001, Stored update 2000 of 5001 -2 * Loglike = 9206.581718 Actual update 2050 of 5001, Stored update 2050 of 5001 -2 * Loglike = 9229.293564 Actual update 2100 of 5001, Stored update 2100 of 5001 -2 * Loglike = 9216.656842 Actual update 2150 of 5001, Stored update 2150 of 5001 -2 * Loglike = 9206.921298 Actual update 2200 of 5001, Stored update 2200 of 5001 -2 * Loglike = 9239.847062 Actual update 2250 of 5001, Stored update 2250 of 5001 -2 * Loglike = 9202.931462 Actual update 2300 of 5001, Stored update 2300 of 5001 -2 * Loglike = 9206.190786 Actual update 2350 of 5001, Stored update 2350 of 5001 -2 * Loglike = 9200.412806 Actual update 2400 of 5001, Stored update 2400 of 5001 -2 * Loglike = 9204.521730 Actual update 2450 of 5001, Stored update 2450 of 5001 -2 * Loglike = 9205.833107 Actual update 2500 of 5001, Stored update 2500 of 5001 -2 * Loglike = 9200.467965 Actual update 2550 of 5001, Stored update 2550 of 5001 -2 * Loglike = 9212.759563 Actual update 2600 of 5001, Stored update 2600 of 5001 -2 * Loglike = 9213.235164 Actual update 2650 of 5001, Stored update 2650 of 5001 -2 * Loglike = 9201.261485 Actual update 2700 of 5001, Stored update 2700 of 5001 -2 * Loglike = 9197.980073 Actual update 2750 of 5001, Stored update 2750 of 5001 -2 * Loglike = 9224.924066 Actual update 2800 of 5001, Stored update 2800 of 5001 -2 * Loglike = 9221.766988 Actual update 2850 of 5001, Stored update 2850 of 5001 -2 * Loglike = 9228.977500 Actual update 2900 of 5001, Stored update 2900 of 5001 -2 * Loglike = 9198.894289 Actual update 2950 of 5001, Stored update 2950 of 5001 -2 * Loglike = 9212.170523 Actual update 3000 of 5001, Stored update 3000 of 5001 -2 * Loglike = 9205.314507 Actual update 3050 of 5001, Stored update 3050 of 5001 -2 * Loglike = 9219.004588 Actual update 3100 of 5001, Stored update 3100 of 5001 -2 * Loglike = 9227.886567 Actual update 3150 of 5001, Stored update 3150 of 5001 -2 * Loglike = 9198.939036 Actual update 3200 of 5001, Stored update 3200 of 5001 -2 * Loglike = 9205.154008 Actual update 3250 of 5001, Stored update 3250 of 5001 -2 * Loglike = 9191.719281 Actual update 3300 of 5001, Stored update 3300 of 5001 -2 * Loglike = 9203.249538 Actual update 3350 of 5001, Stored update 3350 of 5001 -2 * Loglike = 9206.230987 Actual update 3400 of 5001, Stored update 3400 of 5001 -2 * Loglike = 9219.216064 Actual update 3450 of 5001, Stored update 3450 of 5001 -2 * Loglike = 9214.342006 Actual update 3500 of 5001, Stored update 3500 of 5001 -2 * Loglike = 9213.938460 Actual update 3550 of 5001, Stored update 3550 of 5001 -2 * Loglike = 9217.957717 Actual update 3600 of 5001, Stored update 3600 of 5001 -2 * Loglike = 9224.831542 Actual update 3650 of 5001, Stored update 3650 of 5001 -2 * Loglike = 9211.965247 Actual update 3700 of 5001, Stored update 3700 of 5001 -2 * Loglike = 9228.784992 Actual update 3750 of 5001, Stored update 3750 of 5001 -2 * Loglike = 9215.152268 Actual update 3800 of 5001, Stored update 3800 of 5001 -2 * Loglike = 9204.731936 Actual update 3850 of 5001, Stored update 3850 of 5001 -2 * Loglike = 9191.901860 Actual update 3900 of 5001, Stored update 3900 of 5001 -2 * Loglike = 9204.385270 Actual update 3950 of 5001, Stored update 3950 of 5001 -2 * Loglike = 9205.165691 Actual update 4000 of 5001, Stored update 4000 of 5001 -2 * Loglike = 9195.282462 Actual update 4050 of 5001, Stored update 4050 of 5001 -2 * Loglike = 9210.926728 Actual update 4100 of 5001, Stored update 4100 of 5001 -2 * Loglike = 9212.213805 Actual update 4150 of 5001, Stored update 4150 of 5001 -2 * Loglike = 9200.747242 Actual update 4200 of 5001, Stored update 4200 of 5001 -2 * Loglike = 9223.742589 Actual update 4250 of 5001, Stored update 4250 of 5001 -2 * Loglike = 9207.001007 Actual update 4300 of 5001, Stored update 4300 of 5001 -2 * Loglike = 9197.283292 Actual update 4350 of 5001, Stored update 4350 of 5001 -2 * Loglike = 9207.752775 Actual update 4400 of 5001, Stored update 4400 of 5001 -2 * Loglike = 9233.339087 Actual update 4450 of 5001, Stored update 4450 of 5001 -2 * Loglike = 9203.351501 Actual update 4500 of 5001, Stored update 4500 of 5001 -2 * Loglike = 9212.950072 Actual update 4550 of 5001, Stored update 4550 of 5001 -2 * Loglike = 9217.619530 Actual update 4600 of 5001, Stored update 4600 of 5001 -2 * Loglike = 9224.858375 Actual update 4650 of 5001, Stored update 4650 of 5001 -2 * Loglike = 9201.336371 Actual update 4700 of 5001, Stored update 4700 of 5001 -2 * Loglike = 9210.620397 Actual update 4750 of 5001, Stored update 4750 of 5001 -2 * Loglike = 9203.418573 Actual update 4800 of 5001, Stored update 4800 of 5001 -2 * Loglike = 9218.744669 Actual update 4850 of 5001, Stored update 4850 of 5001 -2 * Loglike = 9197.902249 Actual update 4900 of 5001, Stored update 4900 of 5001 -2 * Loglike = 9219.156737 Actual update 4950 of 5001, Stored update 4950 of 5001 -2 * Loglike = 9215.985241 Actual update 5000 of 5001, Stored update 5000 of 5001 -2 * Loglike = 9218.578744 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5001 Average = 9209.1 S.D. = 11.910 S.E.M. = 0.16841 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.7s 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.124 9149.119 60.005 9269.130 --------------------------------------------------------------------------------------------------- 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.00231 0.04036 0.06 0.9544 -0.07769 0.08336 5001 standlrt 0.56324 0.01257 44.79 0 *** 0.53857 0.58782 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.09707 0.01982 0.06485 0.14169 3140 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56618 0.01248 0.54208 0.59093 4750 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > ## 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... Burning in for 50 iterations out of 500 -2 * Loglike = 9132.680377 Burning in for 100 iterations out of 500 -2 * Loglike = 9130.529343 Burning in for 150 iterations out of 500 -2 * Loglike = 9134.882851 Burning in for 200 iterations out of 500 -2 * Loglike = 9147.099708 Burning in for 250 iterations out of 500 -2 * Loglike = 9112.794139 Burning in for 300 iterations out of 500 -2 * Loglike = 9140.267154 Burning in for 350 iterations out of 500 -2 * Loglike = 9101.930503 Burning in for 400 iterations out of 500 -2 * Loglike = 9106.338280 Burning in for 450 iterations out of 500 -2 * Loglike = 9111.183719 Burning in for 500 iterations out of 500 -2 * Loglike = 9149.933574 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 = 9129.275682 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9127.957557 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9120.230173 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9140.628755 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9127.075452 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9111.138797 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9119.600356 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9133.632816 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9148.318155 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9115.717333 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9137.002682 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9106.095041 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9115.727728 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9139.576951 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9117.995914 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9146.868428 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9135.478916 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9095.315140 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9121.863861 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9096.302434 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9133.382890 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9130.186537 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9105.033572 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9111.605314 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9120.348799 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9102.002041 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9114.895204 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9122.306793 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9113.524865 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9113.014106 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9148.128302 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9123.225511 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9130.521840 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9116.367260 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9155.974594 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9133.769165 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9140.461547 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9136.440216 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9123.560695 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9135.146871 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9107.310985 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9130.391893 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9154.202664 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9107.641208 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9122.254609 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9143.748828 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9130.070205 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9133.988858 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9109.099556 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9150.696141 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9140.028236 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9102.089362 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9133.050208 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9153.432952 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9170.076129 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9129.639135 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9147.847607 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9129.426363 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9132.631483 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9125.986164 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9133.321177 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9108.400647 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9102.619819 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9139.155540 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9122.349790 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9146.303835 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9119.690374 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9135.216021 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9126.618903 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9130.121961 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9119.876384 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9130.028964 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9133.586164 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9127.269893 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9111.214454 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9110.462007 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9117.625669 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9116.236788 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9127.971676 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9101.191640 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9111.509954 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9116.086723 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9123.176435 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9123.574736 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9138.870477 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9153.419131 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9122.361701 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9118.733646 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9136.337720 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9118.086113 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9110.614757 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9106.654229 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9103.405561 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9097.824094 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9131.293633 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9123.792946 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9123.659213 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9120.729616 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9126.124600 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9120.132607 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9123.2 S.D. = 16.764 S.E.M. = 0.23708 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 : 5.61s 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 9123.153 9031.727 91.426 9214.579 --------------------------------------------------------------------------------------------------- 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.01136 0.04093 -0.28 0.7814 -0.09229 0.06937 5000 standlrt 0.55678 0.01988 28.01 1.224e-172 *** 0.51708 0.59535 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.09713 0.02011 0.06443 0.14253 2821 cov_Intercept_standlrt 0.01927 0.00736 0.00641 0.03535 1791 var_standlrt 0.01523 0.00481 0.00773 0.02648 874 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.55439 0.01242 0.53038 0.57907 4753 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > 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.57 0.57 18.67