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 > # > # 12 Unordered Categorical Responses . . . . . . . . . . . . . . . . . .167 > # > # 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) > > > ## Read bang data > data(bang, package = "R2MLwiN") > > bang$use4 <- relevel(bang$use4, 4) > > # 12.1 Fitting a first single-level multinomial model . . . . . . . . . .169 > > (mymodel <- runMLwiN(log(use4) ~ 1, D = "Unordered Multinomial", estoptions = list(EstM = 1), data = bang)) 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 iteration 6 iteration 7 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 2 2 2 1 1 6 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 6244.031734 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 6243.061097 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 6241.508099 Adapting finished and took 400 iterations Adapting took 400 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 6246.659558 Burning in for 100 iterations out of 500 -2 * Loglike = 6241.996374 Burning in for 150 iterations out of 500 -2 * Loglike = 6242.992434 Burning in for 200 iterations out of 500 -2 * Loglike = 6241.000772 Burning in for 250 iterations out of 500 -2 * Loglike = 6245.693239 Burning in for 300 iterations out of 500 -2 * Loglike = 6243.237478 Burning in for 350 iterations out of 500 -2 * Loglike = 6240.877923 Burning in for 400 iterations out of 500 -2 * Loglike = 6244.094381 Burning in for 450 iterations out of 500 -2 * Loglike = 6241.685610 Burning in for 500 iterations out of 500 -2 * Loglike = 6239.926321 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 6 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 6242.847714 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 6240.971003 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 6240.200614 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 6240.790226 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 6246.548794 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 6245.932858 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 6240.938999 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 6247.706232 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 6242.407922 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 6242.052826 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 6240.318068 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 6244.310782 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 6247.445990 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 6240.652007 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 6240.603384 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 6241.260432 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 6240.422643 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 6247.940452 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 6243.943495 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 6240.025113 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 6244.513941 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 6245.822420 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 6240.966137 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 6240.822605 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 6243.953862 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 6240.535047 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 6243.883686 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 6242.940633 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 6246.246007 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 6242.207775 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 6240.632888 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 6246.047158 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 6241.084290 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 6240.058486 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 6243.907303 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 6243.047598 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 6247.125683 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 6244.124216 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 6240.392967 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 6241.708128 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 6241.213495 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 6242.821192 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 6243.714840 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 6241.468000 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 6244.488592 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 6242.202333 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 6242.213249 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 6242.950302 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 6240.693079 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 6240.828339 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 6241.567291 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 6242.841888 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 6243.172669 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 6240.092064 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 6241.120236 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 6240.597850 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 6242.238127 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 6245.497703 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 6245.938634 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 6242.025444 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 6241.314773 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 6242.415621 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 6246.803903 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 6242.689243 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 6240.644909 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 6247.506481 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 6240.345652 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 6245.729944 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 6243.675185 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 6240.722281 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 6245.583016 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 6241.790073 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 6241.421633 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 6240.185416 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 6243.174853 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 6240.107113 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 6241.223685 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 6247.664672 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 6242.070811 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 6242.582915 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 6241.793230 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 6240.467422 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 6246.909315 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 6241.567784 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 6242.561150 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 6247.393146 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 6248.199220 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 6240.856421 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 6240.031749 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 6243.999404 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 6245.201292 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 6241.975053 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 6243.421649 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 6240.123743 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 6241.199944 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 6242.197424 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 6240.093358 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 6240.486330 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 6239.988462 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 6243.373291 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 6242.8 S.D. = 2.4467 S.E.M. = 0.034602 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multinomial) Estimation algorithm: MCMC Elapsed time : 6.99s Number of obs: 2867 (from total 2867) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 6242.821 6239.805 3.016 6245.838 --------------------------------------------------------------------------------------------------- The model formula: log(use4) ~ 1 Level 1: l1id --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_Sterilization -1.74851 0.06318 -27.68 1.323e-168 *** -1.87624 -1.62648 1012 Intercept_Modern_reversible_method -1.13878 0.04897 -23.26 1.225e-119 *** -1.23472 -1.04071 963 Intercept_Traditional_method -1.81607 0.06411 -28.33 1.635e-176 *** -1.94120 -1.69018 1059 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the l1id level: Coef. Std. Err. [95% Cred. Interval] ESS bcons_1 1.00000 1e-05 1.00000 1.00000 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > cat(paste("Pr(y = 1) =", round(exp(mymodel@FP["FP_Intercept_Sterilization"])/(1 + exp(mymodel@FP["FP_Intercept_Sterilization"]) + exp(mymodel@FP["FP_Intercept_Modern_reversible_method"]) + + exp(mymodel@FP["FP_Intercept_Traditional_method"])), 4), "\n")) Pr(y = 1) = 0.105 > cat(paste("Pr(y = 2) =", round(exp(mymodel@FP["FP_Intercept_Modern_reversible_method"])/(1 + exp(mymodel@FP["FP_Intercept_Sterilization"]) + exp(mymodel@FP["FP_Intercept_Modern_reversible_method"]) + + exp(mymodel@FP["FP_Intercept_Traditional_method"])), 4), "\n")) Pr(y = 2) = 0.1933 > cat(paste("Pr(y = 3) =", round(exp(mymodel@FP["FP_Intercept_Traditional_method"])/(1 + exp(mymodel@FP["FP_Intercept_Sterilization"]) + exp(mymodel@FP["FP_Intercept_Modern_reversible_method"]) + + exp(mymodel@FP["FP_Intercept_Traditional_method"])), 4), "\n")) Pr(y = 3) = 0.0982 > > # 12.2 Adding predictor variables . . . . . . . . . . . . . . . . . . . .173 > > (mymodel <- runMLwiN(log(use4) ~ 1 + lc, D = "Unordered Multinomial", estoptions = list(EstM = 1), data = bang)) 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 iteration 6 iteration 7 iteration 8 iteration 9 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 2 2 2 1 1 6 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 6041.579437 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 6049.012774 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 6038.215433 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 6033.095801 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 6052.131151 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 6039.717430 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 6036.568153 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 6038.696597 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 6040.377300 Adapting finished and took 1000 iterations Adapting took 1000 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 6035.686905 Burning in for 100 iterations out of 500 -2 * Loglike = 6033.377809 Burning in for 150 iterations out of 500 -2 * Loglike = 6035.073254 Burning in for 200 iterations out of 500 -2 * Loglike = 6040.682245 Burning in for 250 iterations out of 500 -2 * Loglike = 6038.189932 Burning in for 300 iterations out of 500 -2 * Loglike = 6041.968960 Burning in for 350 iterations out of 500 -2 * Loglike = 6041.079758 Burning in for 400 iterations out of 500 -2 * Loglike = 6034.052399 Burning in for 450 iterations out of 500 -2 * Loglike = 6033.056486 Burning in for 500 iterations out of 500 -2 * Loglike = 6038.487352 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 6 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 6038.494814 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 6049.127483 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 6034.855139 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 6060.577767 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 6036.744791 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 6035.533740 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 6038.659099 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 6039.418209 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 6037.245270 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 6042.852643 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 6039.053810 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 6037.244715 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 6044.295206 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 6033.839942 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 6054.551025 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 6036.303709 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 6044.788967 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 6043.860345 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 6035.877478 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 6038.674711 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 6038.714131 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 6044.673502 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 6039.059086 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 6041.834922 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 6040.161186 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 6036.439359 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 6040.411820 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 6037.975643 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 6035.761843 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 6040.897942 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 6035.665729 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 6036.030757 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 6034.128778 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 6040.839484 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 6035.755795 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 6037.638091 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 6036.243326 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 6033.753273 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 6035.560002 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 6033.717771 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 6032.634455 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 6040.125060 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 6041.248930 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 6035.806475 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 6047.959187 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 6040.308567 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 6036.009617 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 6037.421307 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 6038.254351 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 6039.804584 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 6040.245255 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 6043.975669 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 6039.920806 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 6031.314282 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 6035.827326 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 6040.702106 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 6047.501514 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 6043.564972 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 6035.605867 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 6034.133063 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 6037.213149 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 6037.400697 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 6040.580926 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 6038.401290 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 6042.873300 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 6037.605864 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 6043.145708 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 6036.334299 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 6029.622493 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 6046.252807 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 6036.058770 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 6038.711550 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 6038.984527 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 6033.861853 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 6037.316773 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 6041.475019 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 6041.617970 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 6036.196848 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 6050.328764 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 6037.838841 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 6044.444692 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 6040.792549 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 6043.673143 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 6035.117584 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 6039.443912 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 6041.382659 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 6035.667035 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 6041.623387 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 6036.997822 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 6037.395503 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 6042.715116 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 6032.412075 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 6034.373645 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 6042.547341 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 6031.060277 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 6044.876073 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 6038.338887 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 6044.145712 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 6042.020356 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 6043.128360 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 6039.8 S.D. = 4.8857 S.E.M. = 0.069094 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multinomial) Estimation algorithm: MCMC Elapsed time : 19.58s Number of obs: 2867 (from total 2867) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 6039.758 6027.915 11.844 6051.602 --------------------------------------------------------------------------------------------------- The model formula: log(use4) ~ 1 + lc Level 1: l1id --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_Sterilization -3.92924 0.28282 -13.89 6.962e-44 *** -4.55466 -3.44516 30 Intercept_Modern_reversible_method -1.47662 0.09789 -15.08 2.039e-51 *** -1.68104 -1.28860 172 Intercept_Traditional_method -2.62693 0.15019 -17.49 1.686e-68 *** -2.91870 -2.33993 107 lcOne_child_Sterilization 2.22671 0.32762 6.80 1.071e-11 *** 1.63688 2.93656 40 lcOne_child_Modern_reversible_method 0.74308 0.14148 5.25 1.504e-07 *** 0.45856 1.01790 264 lcOne_child_Traditional_method 0.77772 0.21454 3.62 0.000289 *** 0.36507 1.18555 209 lcTwo_children_Sterilization 2.70312 0.32024 8.44 3.152e-17 *** 2.11865 3.37176 42 lcTwo_children_Modern_reversible_method 0.69550 0.14990 4.64 3.486e-06 *** 0.40090 0.99251 253 lcTwo_children_Traditional_method 1.10762 0.21389 5.18 2.238e-07 *** 0.68423 1.52550 206 lcThree_plus_Sterilization 2.61557 0.29285 8.93 4.21e-19 *** 2.10129 3.26153 35 lcThree_plus_Modern_reversible_method 0.21164 0.13420 1.58 0.1148 -0.05306 0.47830 203 lcThree_plus_Traditional_method 1.14562 0.17855 6.42 1.398e-10 *** 0.79797 1.49604 103 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the l1id level: Coef. Std. Err. [95% Cred. Interval] ESS bcons_1 1.00000 1e-05 1.00000 1.00000 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > > cat(paste("Pr(y = 3) =", round(exp(mymodel@FP["FP_Intercept_Traditional_method"])/(1 + exp(mymodel@FP["FP_Intercept_Sterilization"]) + exp(mymodel@FP["FP_Intercept_Modern_reversible_method"]) + + exp(mymodel@FP["FP_Intercept_Traditional_method"])), 4), "\n")) Pr(y = 3) = 0.0548 > cat(paste("Pr(y = 3) =", round(exp(mymodel@FP["FP_Intercept_Traditional_method"] + mymodel@FP["FP_lcTwo_children_Traditional_method"])/(1 + exp(mymodel@FP["FP_Intercept_Sterilization"] + + mymodel@FP["FP_lcTwo_children_Sterilization"]) + exp(mymodel@FP["FP_Intercept_Modern_reversible_method"] + mymodel@FP["FP_lcTwo_children_Modern_reversible_method"]) + exp(mymodel@FP["FP_Intercept_Traditional_method"] + + mymodel@FP["FP_lcTwo_children_Traditional_method"])), 4), "\n")) Pr(y = 3) = 0.1111 > > # 12.3 Interval estimates for conditional probabilities . . . . . . . . .175 > > chains <- mymodel@chains > pred1 <- exp(chains[, "FP_Intercept_Traditional_method"])/(1 + exp(chains[, "FP_Intercept_Sterilization"]) + exp(chains[, "FP_Intercept_Modern_reversible_method"]) + + exp(chains[, "FP_Intercept_Traditional_method"])) > summary(pred1) Iterations = 1:5000 Thinning interval = 1 Number of chains = 1 Sample size per chain = 5000 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE 0.055211 0.007851 0.000111 0.000742 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% 0.04138 0.04956 0.05483 0.06031 0.07150 > sixway(pred1, "prob1") > > pred2 <- exp(chains[, "FP_Intercept_Traditional_method"] + chains[, "FP_lcTwo_children_Traditional_method"])/(1 + exp(chains[, "FP_Intercept_Sterilization"] + chains[, + "FP_lcTwo_children_Sterilization"]) + exp(chains[, "FP_Intercept_Modern_reversible_method"] + chains[, "FP_lcTwo_children_Modern_reversible_method"]) + exp(chains[, "FP_Intercept_Traditional_method"] + + chains[, "FP_lcTwo_children_Traditional_method"])) > summary(pred2) Iterations = 1:5000 Thinning interval = 1 Number of chains = 1 Sample size per chain = 5000 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE 0.1116646 0.0143970 0.0002036 0.0003978 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% 0.08435 0.10167 0.11135 0.12075 0.14125 > sixway(pred2, "prob1") > > # 12.4 Adding district level random effects . . . . . . . . . . . . . . .177 > > ## Uses IGLS > (mymodel <- runMLwiN(log(use4) ~ 1 + lc + (1 | district), D = "Unordered Multinomial", estoptions = list(EstM = 0, + nonlinear = c(1, 2)), data = bang)) /nogui option ignored ECHO 0 Echoing is ON BATC 1 Batch mode is ON MAXI 2 STAR iteration 0 iteration 1 Convergence not achieved TOLE 2 MAXI 20 NEXT iteration 2 iteration 3 iteration 4 iteration 5 iteration 6 iteration 7 iteration 8 iteration 9 iteration 10 iteration 11 Convergence achieved ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multinomial) N min mean max N_complete min_complete mean_complete max_complete district 60 3 47.78333 173 60 3 47.78333 173 Estimation algorithm: IGLS PQL2 Elapsed time : 2.14s Number of obs: 2867 (from total 2867) The model converged after 12 iterations. Log likelihood: NA Deviance statistic: NA --------------------------------------------------------------------------------------------------- The model formula: log(use4) ~ 1 + lc + (1 | district) Level 2: district Level 1: l1id --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Conf. Interval] Intercept_Sterilization -4.22993 0.31881 -13.27 3.564e-40 *** -4.85480 -3.60507 Intercept_Modern_reversible_method -1.74918 0.13254 -13.20 9.053e-40 *** -2.00894 -1.48941 Intercept_Traditional_method -2.72435 0.17870 -15.25 1.771e-52 *** -3.07460 -2.37410 lcOne_child_Sterilization 2.22528 0.33607 6.62 3.556e-11 *** 1.56660 2.88397 lcOne_child_Modern_reversible_method 0.77677 0.14252 5.45 5.032e-08 *** 0.49743 1.05611 lcOne_child_Traditional_method 0.74780 0.22595 3.31 0.0009345 *** 0.30494 1.19066 lcTwo_children_Sterilization 2.82706 0.32911 8.59 8.696e-18 *** 2.18201 3.47210 lcTwo_children_Modern_reversible_method 0.80669 0.15009 5.37 7.668e-08 *** 0.51252 1.10085 lcTwo_children_Traditional_method 1.15238 0.21935 5.25 1.492e-07 *** 0.72245 1.58230 lcThree_plus_Sterilization 2.79627 0.31262 8.94 3.734e-19 *** 2.18355 3.40900 lcThree_plus_Modern_reversible_method 0.33866 0.12964 2.61 0.008993 ** 0.08457 0.59275 lcThree_plus_Traditional_method 1.19256 0.18379 6.49 8.659e-11 *** 0.83234 1.55278 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the district level: Coef. Std. Err. var_Intercept_Sterilization 0.54357 0.15546 cov_Intercept_Sterilization_Intercept_Modern_reversible_method 0.31830 0.09994 var_Intercept_Modern_reversible_method 0.39513 0.10718 cov_Intercept_Sterilization_Intercept_Traditional_method 0.25275 0.09876 cov_Intercept_Modern_reversible_method_Intercept_Traditional_method 0.14217 0.07942 var_Intercept_Traditional_method 0.33141 0.11218 --------------------------------------------------------------------------------------------------- The random part estimates at the l1id level: Coef. Std. Err. bcons_1 1.00000 0.00000 bcons_2 1.00000 0.00000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Warning message: In runMLwiN(log(use4) ~ 1 + lc + (1 | district), D = "Unordered Multinomial", : You specified as log link, but a logit link has been fitted > > ## Uses MCMC > (mymodel <- runMLwiN(log(use4) ~ 1 + lc + (1 | district), D = "Unordered Multinomial", estoptions = list(EstM = 1, + nonlinear = c(1, 2)), data = bang)) 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 iteration 6 iteration 7 iteration 8 iteration 9 iteration 10 iteration 11 Convergence achieved ECHO 0 Echoing is ON MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 2 2 2 1 1 6 Adapting for 100 iterations (Maximum 5000) -2 * Loglike = 5759.485228 Adapting for 200 iterations (Maximum 5000) -2 * Loglike = 5743.492415 Adapting for 300 iterations (Maximum 5000) -2 * Loglike = 5709.808200 Adapting for 400 iterations (Maximum 5000) -2 * Loglike = 5708.422196 Adapting for 500 iterations (Maximum 5000) -2 * Loglike = 5705.730793 Adapting for 600 iterations (Maximum 5000) -2 * Loglike = 5740.365027 Adapting for 700 iterations (Maximum 5000) -2 * Loglike = 5725.398828 Adapting for 800 iterations (Maximum 5000) -2 * Loglike = 5726.229683 Adapting for 900 iterations (Maximum 5000) -2 * Loglike = 5712.919575 Adapting for 1000 iterations (Maximum 5000) -2 * Loglike = 5762.250068 Adapting finished and took 1100 iterations Adapting took 1100 iterations Burning in for 50 iterations out of 500 -2 * Loglike = 5734.814826 Burning in for 100 iterations out of 500 -2 * Loglike = 5731.561380 Burning in for 150 iterations out of 500 -2 * Loglike = 5771.277320 Burning in for 200 iterations out of 500 -2 * Loglike = 5748.462544 Burning in for 250 iterations out of 500 -2 * Loglike = 5689.051154 Burning in for 300 iterations out of 500 -2 * Loglike = 5727.487501 Burning in for 350 iterations out of 500 -2 * Loglike = 5726.547619 Burning in for 400 iterations out of 500 -2 * Loglike = 5741.645899 Burning in for 450 iterations out of 500 -2 * Loglike = 5720.481940 Burning in for 500 iterations out of 500 -2 * Loglike = 5733.843397 ERAS G30 LINK 0 G30 ERAS c1090 c1091 MCMC 1 5000 1 c1090 c1091 c1003 c1004 1 6 Actual update 50 of 5000, Stored update 50 of 5000 -2 * Loglike = 5730.607912 Actual update 100 of 5000, Stored update 100 of 5000 -2 * Loglike = 5751.779632 Actual update 150 of 5000, Stored update 150 of 5000 -2 * Loglike = 5727.282126 Actual update 200 of 5000, Stored update 200 of 5000 -2 * Loglike = 5724.981724 Actual update 250 of 5000, Stored update 250 of 5000 -2 * Loglike = 5718.350436 Actual update 300 of 5000, Stored update 300 of 5000 -2 * Loglike = 5733.162858 Actual update 350 of 5000, Stored update 350 of 5000 -2 * Loglike = 5711.219824 Actual update 400 of 5000, Stored update 400 of 5000 -2 * Loglike = 5719.805791 Actual update 450 of 5000, Stored update 450 of 5000 -2 * Loglike = 5731.387765 Actual update 500 of 5000, Stored update 500 of 5000 -2 * Loglike = 5728.753207 Actual update 550 of 5000, Stored update 550 of 5000 -2 * Loglike = 5726.187560 Actual update 600 of 5000, Stored update 600 of 5000 -2 * Loglike = 5747.203675 Actual update 650 of 5000, Stored update 650 of 5000 -2 * Loglike = 5733.212847 Actual update 700 of 5000, Stored update 700 of 5000 -2 * Loglike = 5695.876158 Actual update 750 of 5000, Stored update 750 of 5000 -2 * Loglike = 5728.970799 Actual update 800 of 5000, Stored update 800 of 5000 -2 * Loglike = 5719.478750 Actual update 850 of 5000, Stored update 850 of 5000 -2 * Loglike = 5731.072606 Actual update 900 of 5000, Stored update 900 of 5000 -2 * Loglike = 5750.861051 Actual update 950 of 5000, Stored update 950 of 5000 -2 * Loglike = 5717.473435 Actual update 1000 of 5000, Stored update 1000 of 5000 -2 * Loglike = 5756.345682 Actual update 1050 of 5000, Stored update 1050 of 5000 -2 * Loglike = 5732.025072 Actual update 1100 of 5000, Stored update 1100 of 5000 -2 * Loglike = 5741.115017 Actual update 1150 of 5000, Stored update 1150 of 5000 -2 * Loglike = 5729.474468 Actual update 1200 of 5000, Stored update 1200 of 5000 -2 * Loglike = 5730.309289 Actual update 1250 of 5000, Stored update 1250 of 5000 -2 * Loglike = 5737.482601 Actual update 1300 of 5000, Stored update 1300 of 5000 -2 * Loglike = 5747.889188 Actual update 1350 of 5000, Stored update 1350 of 5000 -2 * Loglike = 5710.092026 Actual update 1400 of 5000, Stored update 1400 of 5000 -2 * Loglike = 5723.980135 Actual update 1450 of 5000, Stored update 1450 of 5000 -2 * Loglike = 5693.900256 Actual update 1500 of 5000, Stored update 1500 of 5000 -2 * Loglike = 5739.564245 Actual update 1550 of 5000, Stored update 1550 of 5000 -2 * Loglike = 5738.666907 Actual update 1600 of 5000, Stored update 1600 of 5000 -2 * Loglike = 5724.500135 Actual update 1650 of 5000, Stored update 1650 of 5000 -2 * Loglike = 5713.091013 Actual update 1700 of 5000, Stored update 1700 of 5000 -2 * Loglike = 5707.581955 Actual update 1750 of 5000, Stored update 1750 of 5000 -2 * Loglike = 5729.516272 Actual update 1800 of 5000, Stored update 1800 of 5000 -2 * Loglike = 5703.165718 Actual update 1850 of 5000, Stored update 1850 of 5000 -2 * Loglike = 5761.796612 Actual update 1900 of 5000, Stored update 1900 of 5000 -2 * Loglike = 5727.365863 Actual update 1950 of 5000, Stored update 1950 of 5000 -2 * Loglike = 5729.544756 Actual update 2000 of 5000, Stored update 2000 of 5000 -2 * Loglike = 5738.495709 Actual update 2050 of 5000, Stored update 2050 of 5000 -2 * Loglike = 5742.766402 Actual update 2100 of 5000, Stored update 2100 of 5000 -2 * Loglike = 5774.068126 Actual update 2150 of 5000, Stored update 2150 of 5000 -2 * Loglike = 5745.646951 Actual update 2200 of 5000, Stored update 2200 of 5000 -2 * Loglike = 5725.826374 Actual update 2250 of 5000, Stored update 2250 of 5000 -2 * Loglike = 5744.155933 Actual update 2300 of 5000, Stored update 2300 of 5000 -2 * Loglike = 5750.229100 Actual update 2350 of 5000, Stored update 2350 of 5000 -2 * Loglike = 5705.518887 Actual update 2400 of 5000, Stored update 2400 of 5000 -2 * Loglike = 5716.770339 Actual update 2450 of 5000, Stored update 2450 of 5000 -2 * Loglike = 5719.787741 Actual update 2500 of 5000, Stored update 2500 of 5000 -2 * Loglike = 5721.455961 Actual update 2550 of 5000, Stored update 2550 of 5000 -2 * Loglike = 5753.792510 Actual update 2600 of 5000, Stored update 2600 of 5000 -2 * Loglike = 5726.915281 Actual update 2650 of 5000, Stored update 2650 of 5000 -2 * Loglike = 5720.540594 Actual update 2700 of 5000, Stored update 2700 of 5000 -2 * Loglike = 5719.611680 Actual update 2750 of 5000, Stored update 2750 of 5000 -2 * Loglike = 5736.616191 Actual update 2800 of 5000, Stored update 2800 of 5000 -2 * Loglike = 5726.215349 Actual update 2850 of 5000, Stored update 2850 of 5000 -2 * Loglike = 5746.807909 Actual update 2900 of 5000, Stored update 2900 of 5000 -2 * Loglike = 5708.494793 Actual update 2950 of 5000, Stored update 2950 of 5000 -2 * Loglike = 5717.497458 Actual update 3000 of 5000, Stored update 3000 of 5000 -2 * Loglike = 5724.714416 Actual update 3050 of 5000, Stored update 3050 of 5000 -2 * Loglike = 5698.576851 Actual update 3100 of 5000, Stored update 3100 of 5000 -2 * Loglike = 5714.329908 Actual update 3150 of 5000, Stored update 3150 of 5000 -2 * Loglike = 5733.644029 Actual update 3200 of 5000, Stored update 3200 of 5000 -2 * Loglike = 5734.748324 Actual update 3250 of 5000, Stored update 3250 of 5000 -2 * Loglike = 5727.551784 Actual update 3300 of 5000, Stored update 3300 of 5000 -2 * Loglike = 5726.801198 Actual update 3350 of 5000, Stored update 3350 of 5000 -2 * Loglike = 5717.177929 Actual update 3400 of 5000, Stored update 3400 of 5000 -2 * Loglike = 5769.779291 Actual update 3450 of 5000, Stored update 3450 of 5000 -2 * Loglike = 5722.761029 Actual update 3500 of 5000, Stored update 3500 of 5000 -2 * Loglike = 5735.673117 Actual update 3550 of 5000, Stored update 3550 of 5000 -2 * Loglike = 5744.590948 Actual update 3600 of 5000, Stored update 3600 of 5000 -2 * Loglike = 5727.241981 Actual update 3650 of 5000, Stored update 3650 of 5000 -2 * Loglike = 5760.779361 Actual update 3700 of 5000, Stored update 3700 of 5000 -2 * Loglike = 5731.527456 Actual update 3750 of 5000, Stored update 3750 of 5000 -2 * Loglike = 5731.946438 Actual update 3800 of 5000, Stored update 3800 of 5000 -2 * Loglike = 5697.837515 Actual update 3850 of 5000, Stored update 3850 of 5000 -2 * Loglike = 5724.640546 Actual update 3900 of 5000, Stored update 3900 of 5000 -2 * Loglike = 5746.785927 Actual update 3950 of 5000, Stored update 3950 of 5000 -2 * Loglike = 5729.309944 Actual update 4000 of 5000, Stored update 4000 of 5000 -2 * Loglike = 5724.277300 Actual update 4050 of 5000, Stored update 4050 of 5000 -2 * Loglike = 5744.012742 Actual update 4100 of 5000, Stored update 4100 of 5000 -2 * Loglike = 5739.649595 Actual update 4150 of 5000, Stored update 4150 of 5000 -2 * Loglike = 5737.955869 Actual update 4200 of 5000, Stored update 4200 of 5000 -2 * Loglike = 5705.193230 Actual update 4250 of 5000, Stored update 4250 of 5000 -2 * Loglike = 5738.714755 Actual update 4300 of 5000, Stored update 4300 of 5000 -2 * Loglike = 5752.414783 Actual update 4350 of 5000, Stored update 4350 of 5000 -2 * Loglike = 5728.001742 Actual update 4400 of 5000, Stored update 4400 of 5000 -2 * Loglike = 5732.301532 Actual update 4450 of 5000, Stored update 4450 of 5000 -2 * Loglike = 5729.570607 Actual update 4500 of 5000, Stored update 4500 of 5000 -2 * Loglike = 5729.734443 Actual update 4550 of 5000, Stored update 4550 of 5000 -2 * Loglike = 5795.973016 Actual update 4600 of 5000, Stored update 4600 of 5000 -2 * Loglike = 5712.879991 Actual update 4650 of 5000, Stored update 4650 of 5000 -2 * Loglike = 5717.104662 Actual update 4700 of 5000, Stored update 4700 of 5000 -2 * Loglike = 5721.387226 Actual update 4750 of 5000, Stored update 4750 of 5000 -2 * Loglike = 5730.282081 Actual update 4800 of 5000, Stored update 4800 of 5000 -2 * Loglike = 5759.114242 Actual update 4850 of 5000, Stored update 4850 of 5000 -2 * Loglike = 5718.255231 Actual update 4900 of 5000, Stored update 4900 of 5000 -2 * Loglike = 5723.679092 Actual update 4950 of 5000, Stored update 4950 of 5000 -2 * Loglike = 5742.317996 Actual update 5000 of 5000, Stored update 5000 of 5000 -2 * Loglike = 5707.111068 PUPN c1003 c1004 AVER c1091 b99 b100 Count = 5000 Average = 5729.8 S.D. = 17.676 S.E.M. = 0.24997 ECHO 0 Execution completed -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- MLwiN (version: 3.05) multilevel model (Multinomial) N min mean max N_complete min_complete mean_complete max_complete district 60 3 47.78333 173 60 3 47.78333 173 Estimation algorithm: MCMC Elapsed time : 25.95s Number of obs: 2867 (from total 2867) Number of iter.: 5000 Chains: 1 Burn-in: 500 Bayesian Deviance Information Criterion (DIC) Dbar D(thetabar) pD DIC 5729.764 5624.526 105.238 5835.002 --------------------------------------------------------------------------------------------------- The model formula: log(use4) ~ 1 + lc + (1 | district) Level 2: district Level 1: l1id --------------------------------------------------------------------------------------------------- The fixed part estimates: Coef. Std. Err. z Pr(>|z|) [95% Cred. Interval] ESS Intercept_Sterilization -4.22726 0.31820 -13.28 2.83e-40 *** -4.91371 -3.63181 25 Intercept_Modern_reversible_method -1.69568 0.12812 -13.24 5.5e-40 *** -1.95526 -1.44399 98 Intercept_Traditional_method -2.70001 0.17327 -15.58 9.585e-55 *** -3.04685 -2.39816 95 lcOne_child_Sterilization 2.30340 0.32133 7.17 7.588e-13 *** 1.68045 2.97064 41 lcOne_child_Modern_reversible_method 0.77774 0.14830 5.24 1.567e-07 *** 0.49698 1.06821 326 lcOne_child_Traditional_method 0.79012 0.21941 3.60 0.0003169 *** 0.36361 1.22517 267 lcTwo_children_Sterilization 2.86325 0.32754 8.74 2.299e-18 *** 2.21800 3.56197 51 lcTwo_children_Modern_reversible_method 0.77047 0.15674 4.92 8.851e-07 *** 0.45434 1.07705 289 lcTwo_children_Traditional_method 1.13148 0.22049 5.13 2.871e-07 *** 0.71894 1.58119 210 lcThree_plus_Sterilization 2.82135 0.30110 9.37 7.249e-21 *** 2.24834 3.48006 35 lcThree_plus_Modern_reversible_method 0.30561 0.13074 2.34 0.01941 * 0.05060 0.56714 255 lcThree_plus_Traditional_method 1.18613 0.17842 6.65 2.969e-11 *** 0.85664 1.55512 142 Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 --------------------------------------------------------------------------------------------------- The random part estimates at the district level: Coef. Std. Err. [95% Cred. Interval] ESS var_Intercept_Sterilization 0.61011 0.18250 0.33107 1.04853 288 cov_Intercept_Sterilization_Intercept_Modern_reversible_method 0.35867 0.11988 0.16677 0.63873 358 var_Intercept_Modern_reversible_method 0.44035 0.12721 0.24351 0.74495 350 cov_Intercept_Sterilization_Intercept_Traditional_method 0.29735 0.12806 0.08552 0.59017 233 cov_Intercept_Modern_reversible_method_Intercept_Traditional_method 0.16323 0.09277 0.00146 0.36311 389 var_Intercept_Traditional_method 0.39071 0.13549 0.18538 0.69748 206 --------------------------------------------------------------------------------------------------- The random part estimates at the l1id level: Coef. Std. Err. [95% Cred. Interval] ESS bcons_1 1.00000 1e-05 1.00000 1.00000 5000 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- > sixway(mymodel@chains[, "RP2_var_Intercept_Sterilization", drop = FALSE], "sigma2v0") > > RP3.cons <- matrix(, 3, 3) > RP3.cons[upper.tri(RP3.cons, diag = TRUE)] <- mymodel@RP[1:6] > RP3.cons[lower.tri(RP3.cons)] <- RP3.cons[upper.tri(RP3.cons)] > round(cov2cor(RP3.cons), 3) [,1] [,2] [,3] [1,] 1.000 0.692 0.609 [2,] 0.692 1.000 0.394 [3,] 0.609 0.394 1.000 > > # Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . .128 > > > > > > ############################################################################ > > proc.time() user system elapsed 4.73 0.60 61.32