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 > # > # 9 Modelling Complex Variance at Level 1 / Heteroscedasticity. . . . .111 > # > # Browne, W.J. (2009) MCMC Estimation in MLwiN, v2.13. Centre for > # Multilevel Modelling, University of Bristol. > ############################################################################ > # R script to replicate all analyses using R2MLwiN > # > # Zhang, Z., Charlton, C., Parker, R, Leckie, G., and Browne, W.J. > # Centre for Multilevel Modelling, 2012 > # http://www.bristol.ac.uk/cmm/software/R2MLwiN/ > ############################################################################ > > library(R2MLwiN) R2MLwiN: A package to run models implemented in MLwiN from R Copyright 2013-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") > > boy.normexam <- tutorial$normexam[which(tutorial$sex == "boy")] > girl.normexam <- tutorial$normexam[which(tutorial$sex == "girl")] > tab1 <- cbind(c(length(boy.normexam), mean(boy.normexam), sd(boy.normexam)), c(length(girl.normexam), mean(girl.normexam), + sd(girl.normexam)), c(length(tutorial$normexam), mean(tutorial$normexam), sd(tutorial$normexam))) > colnames(tab1) <- c("0", "1", "TOTAL") > rownames(tab1) <- c("N", "MEANS", "SDs") > formatC(round(tab1, 6)) 0 1 TOTAL N "1623" "2436" "4059" MEANS "-0.1404" "0.09332" "-0.000114" SDs "1.026" "0.9697" "0.9989" > > c5 <- tutorial$standlrt > intakecat <- rep(0, length(c5)) > intakecat[which(c5 > -1)] <- 1 > intakecat[which(c5 > -0.5)] <- 2 > intakecat[which(c5 > -0.1)] <- 3 > intakecat[which(c5 > 0.3)] <- 4 > intakecat[which(c5 > 0.7)] <- 5 > intakecat[which(c5 > 1.1)] <- 6 > normexam <- tutorial$normexam > tab2 <- cbind(c(sum(intakecat == 0), mean(normexam[intakecat == 0]), sd(normexam[intakecat == 0])), c(sum(intakecat == + 1), mean(normexam[intakecat == 1]), sd(normexam[intakecat == 1])), c(sum(intakecat == 2), mean(normexam[intakecat == + 2]), sd(normexam[intakecat == 2])), c(sum(intakecat == 3), mean(normexam[intakecat == 3]), sd(normexam[intakecat == + 3])), c(sum(intakecat == 4), mean(normexam[intakecat == 4]), sd(normexam[intakecat == 4])), c(sum(intakecat == + 5), mean(normexam[intakecat == 5]), sd(normexam[intakecat == 5])), c(sum(intakecat == 6), mean(normexam[intakecat == + 6]), sd(normexam[intakecat == 6])), c(length(intakecat), mean(normexam), sd(normexam))) > colnames(tab2) <- c("0", "1", "2", "3", "4", "5", "6", "TOTAL") > rownames(tab2) <- c("N", "MEANS", "SDs") > formatC(round(tab2, 6)) 0 1 2 3 4 5 6 N "612" "594" "619" "710" "547" "428" "549" MEANS "-0.887" "-0.4988" "-0.1908" "0.04392" "0.2785" "0.571" "0.9633" SDs "0.8548" "0.7743" "0.8065" "0.8112" "0.8118" "0.8235" "0.8382" TOTAL N "4059" MEANS "-0.000114" SDs "0.9989" > > # 9.1 MCMC algorithm for a 1 level Normal model with complex variation . 113 > > # 9.2 Setting up the model in MLwiN . . . . . . . . . . . . . . . . . . .115 > > ## The highest level comes first, then the second highest and so on > ## Fit the model > (mymodel1 <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | 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 1 1 1 1 1 1 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9762.996261 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9762.319277 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9761.447474 Adapting finished and took 400 iterations Adapting took 400 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9765.757996 Burning in for 100 iterations out of 500 -2 * Loglike = 9764.468560 Burning in for 150 iterations out of 500 -2 * Loglike = 9762.958048 Burning in for 200 iterations out of 500 -2 * Loglike = 9760.473594 Burning in for 250 iterations out of 500 -2 * Loglike = 9774.294645 Burning in for 300 iterations out of 500 -2 * Loglike = 9762.128736 Burning in for 350 iterations out of 500 -2 * Loglike = 9763.688147 Burning in for 400 iterations out of 500 -2 * Loglike = 9765.068530 Burning in for 450 iterations out of 500 -2 * Loglike = 9769.315381 Burning in for 500 iterations out of 500 -2 * Loglike = 9764.785562 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 = 9769.283591 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9762.905004 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9774.039463 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9762.946825 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9762.540650 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9761.511262 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9763.435597 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9766.073207 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9764.487290 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9767.756031 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9764.085965 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9762.925721 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9765.544151 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9760.429495 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9761.334635 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9762.939083 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9763.552446 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9762.757196 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9769.194340 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9765.401034 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9773.868917 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9768.260484 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9760.936705 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9766.924441 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9762.289608 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9760.471113 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9767.192828 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9765.154386 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9765.596467 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9768.611534 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9760.737576 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9764.677170 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9770.757373 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9761.891929 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9760.115540 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9761.004933 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9762.508291 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9761.831227 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9762.039043 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9768.209100 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9760.647480 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9765.629630 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9770.249846 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9766.256081 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9762.348254 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9761.979402 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9762.060629 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9761.323814 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9764.188146 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9770.896122 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9772.939703 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9762.369407 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9762.760214 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9764.017208 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9764.535113 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9763.812258 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9762.949958 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9760.542499 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9760.939838 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9762.171698 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9772.480431 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9768.543766 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9762.619823 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9762.632060 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9764.598807 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9761.967473 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9770.252964 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9770.358239 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9762.178735 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9763.089541 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9762.458825 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9768.111886 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9764.657145 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9762.330154 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9761.014517 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9767.332258 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9764.214345 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9770.756933 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9765.100740 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9762.241781 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9764.301546 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9761.705568 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9764.253789 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9761.648450 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9775.351751 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9764.881575 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9770.021325 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9765.107736 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9763.797331 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9763.915214 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9765.856062 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9767.294240 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9761.464228 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9766.463261 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9763.284465 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9760.293091 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9761.993250 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9773.594427 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9766.369146 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9764.987410 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9764.5 S.D. = 3.1197 S.E.M. = 0.044119 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Normal) Estimation algorithm: MCMC Elapsed time : 2.76s 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 9764.544 9759.592 4.952 9769.496 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (1 + standlrt | student) Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.00204 0.01274 -0.16 0.8727 -0.02735 0.02321 5000 standlrt 0.59582 0.01328 44.87 0 *** 0.57009 0.62266 5000 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.63893 0.01764 0.60595 0.67447 601 cov_Intercept_standlrt 0.00262 0.00748 -0.01186 0.01741 1088 var_standlrt 0.01159 0.01071 -0.00896 0.03281 556 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > trajectories(mymodel1, Range = c(4501, 5000)) > > l1varfn <- mymodel1@RP["RP1_var_Intercept"] + 2 * mymodel1@RP["RP1_cov_Intercept_standlrt"] * tutorial$standlrt + + mymodel1@RP["RP1_var_standlrt"] * tutorial$standlrt^2 > plot(sort(tutorial$standlrt), l1varfn[order(tutorial$standlrt)], xlab = "standlrt", ylab = "l1varfn", type = "l") > abline(v = 0, lty = "dotted") > > # 9.3 Complex variance functions in multilevel models . . . . . . . . . .119 > > ## The highest level comes first, then the second highest and so on Choose option(s) for inference Fit the model > (mymodel2 <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | 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 = 9145.871584 Burning in for 100 iterations out of 500 -2 * Loglike = 9132.292720 Burning in for 150 iterations out of 500 -2 * Loglike = 9116.964735 Burning in for 200 iterations out of 500 -2 * Loglike = 9109.819138 Burning in for 250 iterations out of 500 -2 * Loglike = 9142.444254 Burning in for 300 iterations out of 500 -2 * Loglike = 9126.443022 Burning in for 350 iterations out of 500 -2 * Loglike = 9158.382599 Burning in for 400 iterations out of 500 -2 * Loglike = 9130.050027 Burning in for 450 iterations out of 500 -2 * Loglike = 9132.164613 Burning in for 500 iterations out of 500 -2 * Loglike = 9095.782185 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 = 9141.251505 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9092.112338 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9114.453660 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9130.042851 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9112.630195 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9127.189612 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9121.760133 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9095.484118 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9119.696741 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9097.278119 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9091.835441 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9147.067486 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9115.848152 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9136.364432 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9122.999236 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9125.626814 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9124.942111 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9123.715072 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9139.162535 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9093.087478 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9103.780217 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9125.714840 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9117.856745 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9104.224610 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9136.726333 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9115.553162 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9135.082659 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9106.260473 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9113.023248 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9128.720286 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9128.243265 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9112.524919 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9116.163849 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9100.141526 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9112.566069 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9129.956343 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9131.034399 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9121.937589 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9094.252149 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9117.545274 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9099.416940 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9132.162100 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9135.159139 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9110.982424 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9112.731006 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9129.335122 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9135.832789 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9115.598454 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9119.806787 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9106.961083 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9094.496029 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9114.022952 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9122.506561 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9108.681836 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9110.341205 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9131.645275 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9143.193063 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9096.461754 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9142.098601 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9090.543006 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9123.431925 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9100.574500 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9135.650108 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9131.254028 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9130.803281 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9137.320115 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9151.055699 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9113.381797 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9136.395805 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9119.182591 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9099.498807 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9094.669026 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9124.954760 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9113.843599 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9122.879346 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9138.609563 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9106.548693 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9104.254128 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9117.331443 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9094.789350 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9135.693654 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9101.392385 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9114.650394 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9113.173542 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9126.374967 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9142.771045 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9133.755790 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9146.895681 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9130.279064 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9126.639139 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9112.546091 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9130.121874 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9102.731900 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9101.131722 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9081.592796 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9107.770592 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9129.044185 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9118.474018 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9118.583370 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9132.471942 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9122.7 S.D. = 16.894 S.E.M. = 0.23892 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 : 2.36s 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.672 9031.177 91.496 9214.168 --------------------------------------------------------------------------------------------------- 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.01325 0.03984 -0.33 0.7395 -0.08901 0.07336 225 standlrt 0.55687 0.02033 27.39 4.031e-165 *** 0.51599 0.59630 563 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.09706 0.02004 0.06544 0.14260 3136 cov_Intercept_standlrt 0.01955 0.00737 0.00647 0.03595 1644 var_standlrt 0.01549 0.00484 0.00804 0.02681 930 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.55432 0.01247 0.53027 0.57958 4575 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > l2varfn <- mymodel2@RP["RP2_var_Intercept"] + 2 * mymodel2@RP["RP2_cov_Intercept_standlrt"] * tutorial$standlrt + + mymodel2@RP["RP2_var_standlrt"] * tutorial$standlrt^2 > l1varfn <- mymodel2@RP["RP1_var_Intercept"] > plot(sort(tutorial$standlrt), l2varfn[order(tutorial$standlrt)], xlab = "standlrt", ylab = "varfns", ylim = c(0, 0.6), + type = "l") > abline(h = l1varfn) > abline(v = 0, lty = "dotted") > > ## Fit the model > (mymodel3 <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 + standlrt | 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 iteration 4 iteration 5 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 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9102.758254 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9114.666904 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9157.483740 Adapting finished and took 400 iterations Adapting took 400 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9145.198470 Burning in for 100 iterations out of 500 -2 * Loglike = 9121.205298 Burning in for 150 iterations out of 500 -2 * Loglike = 9079.612164 Burning in for 200 iterations out of 500 -2 * Loglike = 9137.824571 Burning in for 250 iterations out of 500 -2 * Loglike = 9131.842105 Burning in for 300 iterations out of 500 -2 * Loglike = 9156.006588 Burning in for 350 iterations out of 500 -2 * Loglike = 9109.999434 Burning in for 400 iterations out of 500 -2 * Loglike = 9133.822331 Burning in for 450 iterations out of 500 -2 * Loglike = 9127.691278 Burning in for 500 iterations out of 500 -2 * Loglike = 9117.944157 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 = 9125.132100 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9122.473632 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9136.214676 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9095.661857 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9132.296943 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9097.631407 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9100.827151 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9131.992429 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9133.083569 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9130.993850 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9146.967404 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9097.027761 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9119.683928 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9100.697885 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9120.395074 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9118.466339 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9116.636394 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9132.682922 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9115.739148 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9105.684489 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9121.305903 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9146.198263 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9149.604016 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9133.276263 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9127.645740 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9126.272857 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9097.539650 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9131.136657 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9116.550752 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9085.853946 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9130.628734 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9104.304462 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9135.346122 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9117.041866 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9117.604863 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9129.667895 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9121.940426 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9108.473964 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9095.288561 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9116.969302 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9100.600072 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9121.101822 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9119.557116 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9117.165134 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9116.538961 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9107.477661 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9110.863494 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9107.107600 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9121.636240 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9116.013624 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9101.556177 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9100.716772 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9109.729010 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9168.219789 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9105.869630 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9129.944780 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9106.933771 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9135.166801 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9102.919481 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9112.624335 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9113.535307 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9121.620888 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9129.696491 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9121.135446 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9139.788987 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9110.843225 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9118.238812 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9109.577466 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9112.744417 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9128.345146 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9120.686920 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9121.228166 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9141.553434 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9099.895039 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9158.189299 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9118.309019 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9109.806015 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9108.748936 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9139.791740 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9106.914087 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9127.231420 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9113.756912 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9149.041734 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9148.786883 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9110.877278 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9140.265239 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9124.800291 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9113.833248 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9106.014636 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9156.159320 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9103.008082 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9101.586887 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9148.068765 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9127.381943 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9105.402954 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9132.520291 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9103.578177 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9111.597243 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9160.413096 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9118.318292 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9121.5 S.D. = 16.813 S.E.M. = 0.23777 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.22s 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 9121.491 9029.209 92.283 9213.774 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 + standlrt | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.01153 0.04080 -0.28 0.7774 -0.09358 0.07118 197 standlrt 0.55755 0.02067 26.97 3.206e-160 *** 0.51591 0.59646 547 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.09678 0.01973 0.06535 0.14291 3085 cov_Intercept_standlrt 0.01998 0.00724 0.00724 0.03572 1574 var_standlrt 0.01496 0.00455 0.00787 0.02569 932 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.55315 0.01568 0.52439 0.58474 540 cov_Intercept_standlrt -0.01468 0.00674 -0.02797 -0.00102 904 var_standlrt 0.00307 0.00953 -0.01488 0.02195 469 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > ## Remove term standlrt/standlrt from the level 1 covariance matrix > clre <- matrix(, nrow = 3, ncol = 1) > clre[1, 1] <- 1 > clre[2, 1] <- "standlrt" > clre[3, 1] <- "standlrt" > > ## Fit the model > (mymodel4 <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 + standlrt | student), estoptions = list(EstM = 1, + clre = clre), 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 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9130.934995 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9121.128678 Adapting finished and took 300 iterations Adapting took 300 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9113.975097 Burning in for 100 iterations out of 500 -2 * Loglike = 9128.051181 Burning in for 150 iterations out of 500 -2 * Loglike = 9121.374234 Burning in for 200 iterations out of 500 -2 * Loglike = 9121.082682 Burning in for 250 iterations out of 500 -2 * Loglike = 9133.023786 Burning in for 300 iterations out of 500 -2 * Loglike = 9126.896015 Burning in for 350 iterations out of 500 -2 * Loglike = 9132.689578 Burning in for 400 iterations out of 500 -2 * Loglike = 9163.992533 Burning in for 450 iterations out of 500 -2 * Loglike = 9146.880325 Burning in for 500 iterations out of 500 -2 * Loglike = 9123.738742 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 = 9123.564761 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9150.363686 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9129.317028 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9123.473581 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9150.200504 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9101.102220 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9141.657592 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9082.200255 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9110.565018 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9132.493288 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9118.079398 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9113.942740 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9135.544538 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9137.040698 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9110.385673 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9139.140797 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9092.755594 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9104.294430 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9113.323293 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9104.193788 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9118.794350 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9116.971836 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9097.188649 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9109.815491 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9093.378878 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9129.490076 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9102.667586 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9120.009393 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9120.184431 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9114.157785 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9108.997418 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9100.622049 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9126.204484 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9122.225546 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9128.308366 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9100.335341 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9105.303630 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9115.250181 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9138.156519 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9138.865064 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9100.120392 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9113.752773 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9072.227230 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9122.412413 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9119.799926 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9160.274988 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9136.721811 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9108.791203 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9133.150766 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9105.470813 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9102.086922 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9111.917907 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9119.202300 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9125.537347 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9110.129033 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9167.636737 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9136.368642 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9088.013923 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9106.800213 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9123.835520 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9156.626125 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9112.736919 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9122.803987 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9118.486558 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9099.215589 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9090.048914 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9117.213168 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9100.825377 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9112.293908 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9118.733306 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9115.478211 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9108.245992 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9103.219499 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9118.377238 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9115.758675 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9101.473468 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9140.228942 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9118.751303 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9126.741712 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9115.420124 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9107.870763 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9132.040879 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9128.654213 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9110.999870 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9139.385097 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9122.704205 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9098.291429 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9117.099791 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9137.859682 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9110.738705 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9135.607543 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9129.030556 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9135.336478 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9150.536898 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9119.115874 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9082.629398 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9114.722831 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9116.501411 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9147.539609 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9112.822409 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9119.4 S.D. = 16.713 S.E.M. = 0.23635 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 : 3.75s 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 9119.354 9027.646 91.708 9211.062 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 + standlrt | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.01519 0.03943 -0.39 0.7 -0.09076 0.06121 227 standlrt 0.55661 0.02006 27.74 2.21e-169 *** 0.51752 0.59640 729 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.09648 0.01962 0.06456 0.14038 3308 cov_Intercept_standlrt 0.01991 0.00720 0.00735 0.03539 1673 var_standlrt 0.01524 0.00471 0.00768 0.02624 864 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.55549 0.01275 0.53120 0.58159 908 cov_Intercept_standlrt -0.01483 0.00632 -0.02678 -0.00211 1017 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > # 9.4 Relationship with gender . . . . . . . . . . . . . . . . . . . . . 123 > > tutorial$girl <- as.integer(tutorial$sex) - 1 > > ## Remove term standlrt/standlrt and girl/girl from the level 1 covariance matrix > clre <- matrix(, nrow = 3, ncol = 2) > clre[1, 1] <- 1 > clre[2, 1] <- "standlrt" > clre[3, 1] <- "standlrt" > clre[1, 2] <- 1 > clre[2, 2] <- "girl" > clre[3, 2] <- "girl" > > (mymodel5 <- runMLwiN(normexam ~ 1 + standlrt + girl + (1 + standlrt | school) + (1 + standlrt + girl | student), + estoptions = list(EstM = 1, clre = clre), 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 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9066.438780 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9069.876875 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9072.679118 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 9121.218162 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 9102.755154 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 9064.952244 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 9082.379804 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 9106.774348 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 9057.644499 Adapting for 1000 iterations (Maximum 5000) -2 * Loglike = 9101.290511 Adapting finished and took 1100 iterations Adapting took 1100 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9089.896283 Burning in for 100 iterations out of 500 -2 * Loglike = 9063.353619 Burning in for 150 iterations out of 500 -2 * Loglike = 9069.476790 Burning in for 200 iterations out of 500 -2 * Loglike = 9113.958166 Burning in for 250 iterations out of 500 -2 * Loglike = 9075.067119 Burning in for 300 iterations out of 500 -2 * Loglike = 9084.259464 Burning in for 350 iterations out of 500 -2 * Loglike = 9098.218678 Burning in for 400 iterations out of 500 -2 * Loglike = 9099.199307 Burning in for 450 iterations out of 500 -2 * Loglike = 9105.293850 Burning in for 500 iterations out of 500 -2 * Loglike = 9049.102311 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 = 9077.054212 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9067.008190 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9073.649140 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9092.955776 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9101.210519 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9089.932046 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9092.309600 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9102.738141 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9065.681591 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9065.962654 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9078.305453 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9089.758338 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9092.387548 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9082.907505 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9102.400700 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9123.279539 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9089.282200 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9050.367527 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9066.599872 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9061.533829 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9071.753356 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9064.225267 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9084.915671 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9083.878876 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9135.171139 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9112.126764 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9108.011052 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9083.211807 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9069.918396 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9063.744957 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9096.661190 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9089.751774 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9061.465395 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9054.716343 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9070.470593 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9054.471005 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9092.441651 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9068.369053 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9096.382521 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9068.997451 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9107.882732 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9058.309049 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9099.085751 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9104.475834 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9095.936409 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9064.295863 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9092.668007 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9105.076971 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9087.916837 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9076.367185 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9079.109014 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9058.055688 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9085.629044 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9076.598020 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9074.235938 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9070.450317 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9074.014640 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9088.412693 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9074.329296 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9083.251293 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9072.640348 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9096.513400 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9062.583703 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9061.837728 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9082.551426 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9060.283528 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9083.157303 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9090.349071 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9090.242461 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9083.622673 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9092.775705 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9061.359228 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9086.250094 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9101.975145 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9094.497300 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9084.694989 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9093.752249 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9097.616381 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9111.393080 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9077.825814 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9094.067401 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9075.404724 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9068.933091 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9091.209604 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9078.889913 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9062.396651 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9094.885413 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9143.049008 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9120.389628 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9066.342659 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9097.988009 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9079.002190 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9053.763570 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9093.189393 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9087.988149 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9063.741131 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9108.266193 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9072.751377 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9086.139065 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9083.542718 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9085.1 S.D. = 17.199 S.E.M. = 0.24324 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 : 5.83s 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 9085.126 8991.657 93.470 9178.596 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + girl + (1 + standlrt | school) + (1 + standlrt + girl | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.11624 0.04706 -2.47 0.01351 * -0.21295 -0.02789 213 standlrt 0.55274 0.02178 25.38 3.969e-142 *** 0.50768 0.59250 459 girl 0.17451 0.03276 5.33 9.973e-08 *** 0.11018 0.23805 1751 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.09229 0.01894 0.06143 0.13402 2282 cov_Intercept_standlrt 0.02125 0.00750 0.00843 0.03766 1397 var_standlrt 0.01558 0.00481 0.00786 0.02657 867 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.58605 0.02091 0.54670 0.62704 268 cov_Intercept_standlrt -0.03344 0.00974 -0.05304 -0.01439 276 cov_Intercept_girl -0.02906 0.01283 -0.05509 -0.00493 260 cov_standlrt_girl 0.03159 0.01219 0.00670 0.05505 282 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > l2varfn <- mymodel5@RP["RP2_var_Intercept"] + 2 * mymodel5@RP["RP2_cov_Intercept_standlrt"] * tutorial$standlrt + + mymodel5@RP["RP2_var_standlrt"] * tutorial$standlrt^2 > l1varfnboys <- mymodel5@RP["RP1_var_Intercept"] + 2 * mymodel5@RP["RP1_cov_Intercept_standlrt"] * tutorial$standlrt > l1varfngirls <- mymodel5@RP["RP1_var_Intercept"] + 2 * mymodel5@RP["RP1_cov_Intercept_standlrt"] * tutorial$standlrt + + 2 * mymodel5@RP["RP1_cov_Intercept_girl"] + 2 * mymodel5@RP["RP1_cov_standlrt_girl"] * tutorial$standlrt > plot(sort(tutorial$standlrt), l2varfn[order(tutorial$standlrt)], xlab = "standlrt", ylab = "varfns", ylim = c(0, 0.8), + type = "l") > lines(sort(tutorial$standlrt), l1varfnboys[order(tutorial$standlrt)]) > lines(sort(tutorial$standlrt), l1varfngirls[order(tutorial$standlrt)]) > abline(v = 0, lty = "dotted") > > # 9.5 Alternative log precision formulation . . . . . . . . . . . . . . .126 > > (mymodel6 <- runMLwiN(normexam ~ 1 + standlrt + girl + (1 + standlrt | school) + (1 + standlrt + girl | student), + estoptions = list(EstM = 1, clre = clre, mcmcMeth = list(lclo = 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 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 9061.596689 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 9105.070943 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 9083.479840 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 9093.924414 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 9092.223570 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 9083.250279 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 9086.565200 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 9091.765114 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 9109.572246 Adapting for 1000 iterations (Maximum 5000) -2 * Loglike = 9074.515989 Adapting finished and took 1100 iterations Adapting took 1100 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 9062.730829 Burning in for 100 iterations out of 500 -2 * Loglike = 9091.142027 Burning in for 150 iterations out of 500 -2 * Loglike = 9112.733041 Burning in for 200 iterations out of 500 -2 * Loglike = 9081.356390 Burning in for 250 iterations out of 500 -2 * Loglike = 9081.330347 Burning in for 300 iterations out of 500 -2 * Loglike = 9068.537736 Burning in for 350 iterations out of 500 -2 * Loglike = 9047.842691 Burning in for 400 iterations out of 500 -2 * Loglike = 9097.643636 Burning in for 450 iterations out of 500 -2 * Loglike = 9092.177468 Burning in for 500 iterations out of 500 -2 * Loglike = 9119.969019 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 = 9106.371497 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 9081.541992 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 9079.215374 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 9087.858843 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 9082.036756 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 9083.127688 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 9072.281059 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 9063.466962 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 9116.132218 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 9088.692685 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 9117.733362 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 9070.673969 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 9103.925869 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 9088.384512 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 9056.360998 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 9088.324786 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 9079.651886 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 9077.172264 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 9090.814900 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 9125.746104 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 9086.662818 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 9088.448213 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 9091.744729 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 9042.900959 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 9101.033827 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 9091.990613 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 9089.483609 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 9113.570856 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 9089.957937 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 9099.470866 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 9093.862708 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 9074.320928 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 9055.655071 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 9054.706536 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 9115.908164 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 9075.528468 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 9075.193729 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 9088.622775 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 9122.338965 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 9092.577242 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 9088.228008 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 9081.021916 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 9088.319665 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 9101.529149 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 9080.784615 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 9103.083679 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 9081.064561 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 9071.146604 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 9060.724168 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 9083.322352 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 9086.145111 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 9115.516883 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 9104.354567 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 9095.003593 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 9088.817570 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 9098.103497 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 9088.562582 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 9079.959363 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 9101.764361 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 9071.181851 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 9102.995316 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 9066.600290 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 9102.419645 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 9064.790817 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 9079.946200 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 9086.696163 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 9101.909678 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 9083.167744 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 9097.008500 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 9059.156578 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 9084.414198 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 9050.320145 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 9087.909291 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 9163.110121 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 9084.776771 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 9095.959627 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 9078.748165 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 9061.586282 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 9081.174117 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 9050.009493 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 9065.168763 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 9095.797161 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 9080.472083 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 9076.187603 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 9083.178187 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 9084.441194 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 9073.950014 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 9103.112411 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 9092.894775 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 9081.942288 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 9070.257606 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 9103.461749 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 9092.033015 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 9101.795453 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 9097.237109 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 9072.963674 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 9089.579418 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 9079.326982 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 9063.508536 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 9074.073566 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 9085.5 S.D. = 16.929 S.E.M. = 0.23941 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 : 8.06s 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 9085.464 8991.475 93.989 9179.453 --------------------------------------------------------------------------------------------------- The model formula: normexam ~ 1 + standlrt + girl + (1 + standlrt | school) + (1 + standlrt + girl | student) Level 2: school Level 1: student --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept -0.11561 0.04173 -2.77 0.005603 ** -0.19875 -0.03422 331 standlrt 0.55338 0.02054 26.94 7.244e-160 *** 0.51272 0.59411 728 girl 0.17522 0.03160 5.55 2.929e-08 *** 0.11153 0.23620 1867 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.09162 0.01860 0.06113 0.13418 3081 cov_Intercept_standlrt 0.02092 0.00718 0.00866 0.03682 1589 var_standlrt 0.01579 0.00472 0.00849 0.02660 1009 --------------------------------------------------------------------------------------------------- The random part estimates at the student level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept 0.54422 0.03739 0.47140 0.61806 265 cov_Intercept_standlrt 0.05378 0.01814 0.01769 0.08972 333 cov_Intercept_girl 0.04847 0.02382 0.00322 0.09631 262 cov_standlrt_girl -0.05079 0.02420 -0.09860 -0.00277 303 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > l2varfn <- mymodel6@RP["RP2_var_Intercept"] + 2 * mymodel6@RP["RP2_cov_Intercept_standlrt"] * tutorial$standlrt + + mymodel6@RP["RP2_var_standlrt"] * tutorial$standlrt^2 > l1varfnboys <- 1/exp(mymodel6@RP["RP1_var_Intercept"] + 2 * mymodel6@RP["RP1_cov_Intercept_standlrt"] * tutorial$standlrt) > l1varfngirls <- 1/exp(mymodel6@RP["RP1_var_Intercept"] + 2 * mymodel6@RP["RP1_cov_Intercept_standlrt"] * tutorial$standlrt + + 2 * mymodel6@RP["RP1_cov_Intercept_girl"] + 2 * mymodel6@RP["RP1_cov_standlrt_girl"] * tutorial$standlrt) > plot(sort(tutorial$standlrt), l2varfn[order(tutorial$standlrt)], xlab = "standlrt", ylab = "varfns", ylim = c(0, 0.8), + type = "l") > lines(sort(tutorial$standlrt), l1varfnboys[order(tutorial$standlrt)]) > lines(sort(tutorial$standlrt), l1varfngirls[order(tutorial$standlrt)]) > abline(v = 0, lty = "dotted") > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . .128 > > > > > > ############################################################################ > > proc.time() user system elapsed 6.14 0.79 35.90