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 > # > # 3 Variance Components Models . . . . . . . . . . . . . . . . . . . . .35 > # > # 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/ > ############################################################################ > > # 3.1 A 2 level variance components model for the Tutorial dataset . . . .36 > > 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) > > ## save current par settings > mypar <- par(no.readonly = TRUE) > > ## Read tutorial data > data(tutorial, package = "R2MLwiN") > > ## The highest level comes first, then the second highest and so on > (mymodel1 <- runMLwiN(normexam ~ 1 + standlrt + (1 | school) + (1 | student), estoptions = list(EstM = 1), data = tutorial)) MLwiN is running, please wait...... /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 BATC 1 Batch mode is ON NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 1 Burning in for 50 iterations out of 500 -2 * Loglike = 9204.262556 Burning in for 100 iterations out of 500 -2 * Loglike = 9225.063419 Burning in for 150 iterations out of 500 -2 * Loglike = 9205.620423 Burning in for 200 iterations out of 500 -2 * Loglike = 9207.286175 Burning in for 250 iterations out of 500 -2 * Loglike = 9189.882541 Burning in for 300 iterations out of 500 -2 * Loglike = 9213.131781 Burning in for 350 iterations out of 500 -2 * Loglike = 9191.967839 Burning in for 400 iterations out of 500 -2 * Loglike = 9200.072789 Burning in for 450 iterations out of 500 -2 * Loglike = 9197.978878 Burning in for 500 iterations out of 500 -2 * Loglike = 9206.312775 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 = 9182.514808 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9224.799767 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9192.533264 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9235.302728 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9192.588497 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9200.798346 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9215.971258 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9191.471053 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9216.792403 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9185.644474 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9203.752807 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9201.223665 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9215.804872 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9204.519349 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9189.609771 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9213.416013 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9211.107554 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9219.303837 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9195.273065 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9191.690604 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9215.236489 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9218.185496 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9210.517749 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9225.032838 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9202.460499 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9225.333397 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9208.977623 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9210.427472 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9225.575111 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9202.428957 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9200.886427 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9198.521334 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9207.777166 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9198.900296 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9208.265053 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9203.987061 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9207.776243 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9215.497296 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9224.467108 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9194.146736 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9212.845807 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9224.944089 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9213.612843 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9198.265355 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9195.222358 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9250.643212 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9194.598687 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9214.421500 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9240.315838 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9235.012216 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9188.825586 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9220.910444 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9198.293627 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9205.222052 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9209.264188 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9211.039764 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9230.996469 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9224.580436 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9199.499799 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9215.292584 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9207.040587 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9202.604250 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9216.541549 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9205.256474 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9211.029403 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9186.699312 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9210.823399 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9207.867998 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9219.418322 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9206.509889 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9211.940598 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9209.426437 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9217.104187 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9206.433860 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9208.530610 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9212.678566 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9201.101902 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9202.943453 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9226.646620 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9199.272707 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9185.496662 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9204.693995 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9205.338782 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9218.098365 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9192.878156 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9211.471250 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9217.216161 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9214.835575 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9208.972779 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9223.102763 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9203.956845 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9201.960121 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9194.101999 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9207.476225 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9215.003009 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9186.582930 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9202.744286 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9228.521835 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9210.720494 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9214.075214 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9208.8 S.D. = 12.005 S.E.M. = 0.16978 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.42s 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.817 9148.971 59.846 9268.664 --------------------------------------------------------------------------------------------------- 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.00133 0.04216 0.03 0.9748 -0.07762 0.08519 208 standlrt 0.56331 0.01254 44.93 0 *** 0.53892 0.58799 4017 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.09732 0.02049 0.06441 0.14454 2981 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56634 0.01269 0.54175 0.59197 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > if (!require(coda)) { + warning("package coda required to run this example") + } else { + estimates <- mymodel1@chains + par(mfrow = c(3, 2)) + plot(4501:niter(estimates), estimates[4501:niter(estimates), "deviance"], xlab = "iteration", ylab = expression(paste("Est. of deviance")), + type = "l") + plot(4501:niter(estimates), estimates[4501:niter(estimates), "FP_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + beta[0])), type = "l") + plot(4501:niter(estimates), estimates[4501:niter(estimates), "FP_standlrt"], xlab = "iteration", ylab = expression(paste("Est. of ", + beta[1])), type = "l") + plot(4501:niter(estimates), estimates[4501:niter(estimates), "RP2_var_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + sigma[u0]^2)), type = "l") + plot(4501:niter(estimates), estimates[4501:niter(estimates), "RP1_var_Intercept"], xlab = "iteration", ylab = expression(paste("Est. of ", + sigma[e0]^2)), type = "l") + ## reinstate par settings + par(mypar) + } Loading required package: coda > > sixway(mymodel1@chains[, "FP_standlrt", drop = FALSE], "beta_1") > sixway(mymodel1@chains[, "RP2_var_Intercept", drop = FALSE], "sigma2u0") > > # 3.2 DIC and multilevel models . . . . . . . . . . . . . . . . . . . . . 41 > > # 3.3 Comparison between fixed and random school effects . . . . . . . . .41 > > (mymodel2 <- runMLwiN(normexam ~ 1 + standlrt + sex + (1 | school) + (1 | student), estoptions = list(EstM = 1), data = tutorial)) MLwiN is running, please wait...... /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 BATC 1 Batch mode is ON NEXT iteration 2 iteration 3 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 1 1 1 1 1 1 Burning in for 50 iterations out of 500 -2 * Loglike = 9181.270470 Burning in for 100 iterations out of 500 -2 * Loglike = 9169.980786 Burning in for 150 iterations out of 500 -2 * Loglike = 9163.689876 Burning in for 200 iterations out of 500 -2 * Loglike = 9185.535655 Burning in for 250 iterations out of 500 -2 * Loglike = 9174.453302 Burning in for 300 iterations out of 500 -2 * Loglike = 9193.020958 Burning in for 350 iterations out of 500 -2 * Loglike = 9175.035276 Burning in for 400 iterations out of 500 -2 * Loglike = 9185.703019 Burning in for 450 iterations out of 500 -2 * Loglike = 9210.526711 Burning in for 500 iterations out of 500 -2 * Loglike = 9173.792760 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 = 9202.530003 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9190.378039 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9188.010225 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9182.852575 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9173.957671 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9184.552675 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9160.970002 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9200.063377 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9178.026008 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9174.875764 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9177.644754 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9178.779270 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9199.280515 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9173.154865 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9177.607855 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9171.846060 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9193.926564 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9190.725371 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9178.212852 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9180.060307 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9169.771026 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9185.790279 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9191.674662 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9192.638555 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9181.080311 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9202.017408 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9188.780598 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9176.128907 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9184.452334 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9217.516482 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9182.894173 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9187.859598 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9179.595486 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9175.491839 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9171.754269 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9179.106013 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9202.123633 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9191.001772 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9180.356613 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9177.789297 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9186.661295 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9187.975478 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9181.922806 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9194.002533 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9177.781113 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9192.844556 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9181.477385 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9183.157064 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9199.336107 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9177.949353 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9191.082809 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9185.352385 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9178.171274 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9224.802062 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9177.831945 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9189.930627 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9194.601591 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9216.178340 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9173.738788 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9191.902138 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9193.772214 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9190.718966 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9179.819724 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9186.850068 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9179.284089 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9193.988815 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9173.434373 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9198.291162 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9179.401528 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9202.850247 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9193.258201 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9188.842017 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9184.324904 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9180.647712 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9172.493531 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9204.299211 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9186.882300 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9180.723640 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9197.259454 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9184.999450 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9175.371541 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9189.478919 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9162.924976 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9180.337904 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9183.478704 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9185.018768 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9176.124035 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9177.332764 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9178.494910 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9182.696684 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9191.048924 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9171.832291 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9177.754383 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9189.901778 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9190.113340 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9195.173309 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9193.722014 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9188.537692 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9198.740553 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9176.298090 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9184.7 S.D. = 12.079 S.E.M. = 0.17083 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.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 9184.678 9124.278 60.400 9245.077 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + sex + (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.09649 0.04261 -2.26 0.02354 * -0.17894 -0.01062 263 standlrt 0.55936 0.01258 44.45 0 *** 0.53516 0.58370 4624 sexgirl 0.17067 0.03233 5.28 1.3e-07 *** 0.10795 0.23375 1829 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.09279 0.01927 0.06239 0.13576 3093 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.56310 0.01280 0.53880 0.58886 5078 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . . 43 > > > > ############################################################################ > > proc.time() user system elapsed 3.68 0.28 7.43