------------------------------------------------------------------------------- name: log: Q:\C-modelling\runmlwin\website\logfiles\2020-03-27\16\11_Fitting_ > an_Ordered_Category_Response_Model.smcl log type: smcl opened on: 27 Mar 2020, 17:42:27 . **************************************************************************** . * MLwiN User Manual . * . * 11 Fitting an Ordered Category Response Model 161 . * . * Rasbash, J., Steele, F., Browne, W. J. and Goldstein, H. (2012). . * A User’s Guide to MLwiN, v2.26. Centre for Multilevel Modelling, . * University of Bristol. . **************************************************************************** . * Stata do-file to replicate all analyses using runmlwin . * . * George Leckie and Chris Charlton, . * Centre for Multilevel Modelling, 2012 . * http://www.bristol.ac.uk/cmm/software/runmlwin/ . **************************************************************************** . . * 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .161 . . use "http://www.bristol.ac.uk/cmm/media/runmlwin/alevchem.dta", clear . . describe Contains data from http://www.bristol.ac.uk/cmm/media/runmlwin/alevchem.dta obs: 2,166 vars: 8 21 Oct 2011 12:19 ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- lea int %9.0g LEA ID estab int %9.0g Establishment ID pupil float %9.0g Pupil ID a_point byte %9.0g a_point A-level point score gcse_tot byte %9.0g Total GCSE point score gcse_no byte %9.0g Number of GCSEs taken cons byte %9.0g Constant gender byte %9.0g gender Gender ------------------------------------------------------------------------------- Sorted by: . . . . * 11.2 An analysis using the traditional approach . . . . . . . . . . . .162 . . histogram a_point, discrete frequency gap(50) xlabel(1(1)6, valuelabel) (start=1, width=1) . . egen a_point_rank = rank(a_point) . . generate a_point_uniform = (a_point_rank - 0.5)/_N . . generate alevelnormal = invnorm(a_point_uniform) . . runmlwin alevelnormal cons, level1(pupil: cons) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 0.58 Number of iterations = 2 Log likelihood = -2816.8534 Deviance = 5633.7068 ------------------------------------------------------------------------------ alevelnormal | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | .0027892 .0190866 0.15 0.884 -.0346198 .0401981 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: pupil | var(cons) | .7890667 .0239773 .7420722 .8360613 ------------------------------------------------------------------------------ . . generate gcseav = gcse_tot/gcse_no . . egen gcseav_rank = rank(gcseav) . . generate gcseav_uniform = (gcseav_rank - 0.5)/_N . . generate gcseavnormal = invnorm(gcseav_uniform) . . generate gcse2 = gcseavnormal^2 . . generate gcse3 = gcseavnormal^3 . . rename gender female . . runmlwin alevelnormal cons female gcseavnormal gcse2 gcse3, /// > level1(pupil: cons) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 0.53 Number of iterations = 2 Log likelihood = -1984.4282 Deviance = 3968.8563 ------------------------------------------------------------------------------ alevelnormal | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | .0774798 .0197864 3.92 0.000 .0386991 .1162605 female | -.2462569 .0266518 -9.24 0.000 -.2984935 -.1940202 gcseavnormal | .7868259 .0212583 37.01 0.000 .7451604 .8284914 gcse2 | .0324995 .0092816 3.50 0.000 .0143078 .0506911 gcse3 | -.0456185 .0055814 -8.17 0.000 -.0565577 -.0346792 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: pupil | var(cons) | .3658494 .011117 .3440605 .3876384 ------------------------------------------------------------------------------ . . runmlwin alevelnormal cons female gcseavnormal gcse2, /// > level1(pupil: cons) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 0.54 Number of iterations = 2 Log likelihood = -2017.3252 Deviance = 4034.6505 ------------------------------------------------------------------------------ alevelnormal | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | .0714179 .0200751 3.56 0.000 .0320714 .1107645 female | -.2355147 .0270268 -8.71 0.000 -.2884862 -.1825431 gcseavnormal | .6507043 .0134139 48.51 0.000 .6244136 .676995 gcse2 | .0340741 .0094216 3.62 0.000 .0156081 .0525402 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: pupil | var(cons) | .3771329 .0114599 .354672 .3995939 ------------------------------------------------------------------------------ . . runmlwin alevelnormal cons female, level1(pupil: cons) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 0.51 Number of iterations = 2 Log likelihood = -2816.8293 Deviance = 5633.6586 ------------------------------------------------------------------------------ alevelnormal | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | .0064703 .0254003 0.25 0.799 -.0433134 .0562539 female | -.0084553 .0384957 -0.22 0.826 -.0839054 .0669949 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: pupil | var(cons) | .7890491 .0239767 .7420556 .8360427 ------------------------------------------------------------------------------ . . runmlwin gcseavnormal cons female, level1(pupil: cons) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Normal response model (hierarchical) Estimation algorithm: IGLS Run time (seconds) = 0.54 Number of iterations = 2 Log likelihood = -3037.8323 Deviance = 6075.6645 ------------------------------------------------------------------------------ gcseavnormal | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- cons | -.1526866 .0281288 -5.43 0.000 -.207818 -.0975552 female | .3503746 .0426309 8.22 0.000 .2668196 .4339296 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 1: pupil | var(cons) | .9676729 .0294045 .9100411 1.025305 ------------------------------------------------------------------------------ . . . . * 11.3 A single-level model with an ordered categorical response variable 166 . . runmlwin a_point cons, /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6)) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, MQL1 ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 0.85 Number of iterations = 4 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -1.398436 .0537743 -26.01 0.000 -1.503831 -1.29304 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -.701469 .0456439 -15.37 0.000 -.7909294 -.6120086 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | -.0998058 .043027 -2.32 0.020 -.1841371 -.0154744 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | .5949758 .0448891 13.25 0.000 .5069947 .6829568 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 1.602796 .0574293 27.91 0.000 1.490236 1.715355 ------------------------------------------------------------------------------ . . . * 11.4 A two-level model . . . . . . . . . . . . . . . . . . . . . . . . 171 . egen school = group(lea estab) . // Note: Establishment codes on their own do not uniquely identify schools. . // Schools are instead uniquely identified by LEA code, establishment ID . // combination. Thus, here we generated a unique school ID. . . runmlwin a_point cons, /// > level2(school: (cons, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6)) /// > nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, MQL1 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 0.84 Number of iterations = 5 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -1.093818 .0826573 -13.23 0.000 -1.255824 -.9318128 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -.4101376 .0793844 -5.17 0.000 -.5657281 -.2545471 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | .1795528 .078982 2.27 0.023 .0247509 .3343548 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | .8622601 .0811775 10.62 0.000 .7031552 1.021365 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 1.859279 .0912814 20.37 0.000 1.680371 2.038188 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(cons_12345) | .7382661 .1154879 .511914 .9646182 ------------------------------------------------------------------------------ . // Note: Here we get slightly different results to those presented in the . // manual. The results presented here are correct. The results presented in . // the manual are incorrect. The error in the manual related to the fact . // that that LEAs 311 and 315 appear consecutively in the dataset and that . // each LEA only has one school and the ID for those two schools is the . // same. (The estab ID for both schools is 8000). In sum, two distinct . // schools appear in the data consecutively with the same Estab ID. MLwiN . // will incorectly treat these two schools as being the same establishment. . // The creation and use of the school ID above avoids this problem as now . // every schools has a unique ID. This issue applies to all the models in . // this chapter and so you will see slightly different results to those . // presented in the manual for all the remaining models in this chapter. . . runmlwin a_point cons, /// > level2(school: (cons, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 1.32 Number of iterations = 8 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -1.372275 .1031697 -13.30 0.000 -1.574484 -1.170066 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -.4809892 .0982812 -4.89 0.000 -.6736169 -.2883616 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | .2940196 .0976683 3.01 0.003 .1025932 .4854459 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.171295 .1001301 11.70 0.000 .9750433 1.367546 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 2.391542 .1099275 21.76 0.000 2.176088 2.606996 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(cons_12345) | 1.329894 .1784171 .9802028 1.679585 ------------------------------------------------------------------------------ . . runmlwin a_point cons (gcseavnormal, contrast(1/5)), /// > level2(school: (cons, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 1.59 Number of iterations = 11 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -2.292551 .1002842 -22.86 0.000 -2.489105 -2.095998 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -1.091689 .0895633 -12.19 0.000 -1.26723 -.9161486 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | -.0194485 .0863879 -0.23 0.822 -.1887656 .1498686 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.213158 .0899398 13.49 0.000 1.036879 1.389437 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 2.943511 .1077083 27.33 0.000 2.732406 3.154615 -------------+---------------------------------------------------------------- gcseav~12345 | -2.039157 .0650732 -31.34 0.000 -2.166698 -1.911616 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(cons_12345) | .7168638 .1178746 .4858339 .9478938 ------------------------------------------------------------------------------ . . runmlwin a_point cons gcseavnormal, /// > level2(school: (cons, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 1.90 Number of iterations = 12 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -2.236721 .1160879 -19.27 0.000 -2.46425 -2.009193 gcseavnorm~1 | -1.942264 .1027307 -18.91 0.000 -2.143613 -1.740916 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -1.053706 .0934013 -11.28 0.000 -1.236769 -.8706432 gcseavnorm~2 | -1.945373 .090399 -21.52 0.000 -2.122551 -1.768194 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | .0103846 .0869491 0.12 0.905 -.1600325 .1808017 gcseavnorm~3 | -1.929405 .0865203 -22.30 0.000 -2.098982 -1.759828 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.251249 .0940388 13.31 0.000 1.066936 1.435562 gcseavnorm~4 | -2.023207 .0918843 -22.02 0.000 -2.203297 -1.843117 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 3.200175 .143901 22.24 0.000 2.918135 3.482216 gcseavnorm~5 | -2.341769 .1234898 -18.96 0.000 -2.583805 -2.099734 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(cons_12345) | .7092022 .1170688 .4797516 .9386528 ------------------------------------------------------------------------------ . . runmlwin a_point cons (gcseavnormal female gcse2, contrast(1/5)), /// > level2(school: (cons, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) nopause MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 1.72 Number of iterations = 10 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -2.491519 .1156317 -21.55 0.000 -2.718153 -2.264885 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -1.308492 .1035693 -12.63 0.000 -1.511484 -1.1055 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | -.2306094 .099196 -2.32 0.020 -.42503 -.0361888 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.037689 .1024133 10.13 0.000 .8369631 1.238416 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 2.878131 .1246641 23.09 0.000 2.633794 3.122468 -------------+---------------------------------------------------------------- gcseav~12345 | -2.18918 .0689091 -31.77 0.000 -2.324239 -2.054121 female_12345 | .7427728 .0941715 7.89 0.000 .5582001 .9273456 gcse2_12345 | -.2376391 .0445499 -5.33 0.000 -.3249553 -.1503228 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(cons_12345) | .6669896 .111927 .4476167 .8863625 ------------------------------------------------------------------------------ . . runmlwin a_point cons (gcseavnormal female gcse2, contrast(1/5)), /// > level2(school: (cons gcseavnormal, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) /// > initsprevious nopause Model fitted using initial values specified as parameter estimates from previou > s model MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 2.35 Number of iterations = 12 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -2.537956 .117351 -21.63 0.000 -2.767959 -2.307952 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -1.323957 .1045857 -12.66 0.000 -1.528941 -1.118972 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | -.2282756 .1000226 -2.28 0.022 -.4243163 -.032235 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.05673 .1033586 10.22 0.000 .8541506 1.259309 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 2.938005 .1270412 23.13 0.000 2.689008 3.187001 -------------+---------------------------------------------------------------- gcseav~12345 | -2.251657 .0825339 -27.28 0.000 -2.413421 -2.089894 female_12345 | .7457303 .0953481 7.82 0.000 .5588514 .9326091 gcse2_12345 | -.2251286 .0491199 -4.58 0.000 -.3214019 -.1288552 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(gcseavnormal_12345) | .2143122 .0795046 .058486 .3701385 cov(gcseav~12345,cons_12345) | .0542847 .0676103 -.078229 .1867983 var(cons_12345) | .6585851 .116295 .430651 .8865192 ------------------------------------------------------------------------------ . . display invlogit([FP1]cons_1) .07323982 . . display invlogit([FP2]cons_2) .21016078 . . display invlogit([FP3]cons_3) .44317762 . . display invlogit([FP4]cons_4) .74206511 . . display invlogit([FP5]cons_5) .94969348 . . . display invlogit([FP1]cons_1 + [FP6]gcseavnormal_12345) .0082471 . . display invlogit([FP2]cons_2 + [FP6]gcseavnormal_12345) .02723569 . . display invlogit([FP3]cons_3 + [FP6]gcseavnormal_12345) .077277 . . display invlogit([FP4]cons_4 + [FP6]gcseavnormal_12345) .23237885 . . display invlogit([FP5]cons_5 + [FP6]gcseavnormal_12345) .66515391 . . runmlwin a_point cons (gcseavnormal female gcse2, contrast(1/5)), /// > level2(school: (cons gcseavnormal female, contrast(1/5))) /// > level1(pupil) /// > discrete(distribution(multinomial) link(ologit) denominator(cons) bas > ecategory(6) pql2) /// > initsprevious nopause Model fitted using initial values specified as parameter estimates from previou > s model MLwiN 3.05 multilevel model Number of obs = 2166 Ordered multinomial logit response model (hierarchical) Estimation algorithm: IGLS, PQL2 ----------------------------------------------------------- | No. of Observations per Group Level Variable | Groups Minimum Average Maximum ----------------+------------------------------------------ school | 220 1 9.8 94 ----------------------------------------------------------- ---------------------------------- Contrast | Log-odds -------------+-------------------- 1 | 1 vs. 2 3 4 5 6 2 | 1 2 vs. 3 4 5 6 3 | 1 2 3 vs. 4 5 6 4 | 1 2 3 4 vs. 5 6 5 | 1 2 3 4 5 vs. 6 ---------------------------------- Run time (seconds) = 3.33 Number of iterations = 16 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Contrast 1 | cons_1 | -2.596984 .1199665 -21.65 0.000 -2.832114 -2.361854 -------------+---------------------------------------------------------------- Contrast 2 | cons_2 | -1.359788 .1066465 -12.75 0.000 -1.568811 -1.150765 -------------+---------------------------------------------------------------- Contrast 3 | cons_3 | -.2451452 .101831 -2.41 0.016 -.4447303 -.0455601 -------------+---------------------------------------------------------------- Contrast 4 | cons_4 | 1.059096 .1051824 10.07 0.000 .852942 1.265249 -------------+---------------------------------------------------------------- Contrast 5 | cons_5 | 2.960771 .1293588 22.89 0.000 2.707232 3.214309 -------------+---------------------------------------------------------------- gcseav~12345 | -2.284919 .0820453 -27.85 0.000 -2.445725 -2.124114 female_12345 | .7826169 .1108804 7.06 0.000 .5652953 .9999385 gcse2_12345 | -.2277553 .0493037 -4.62 0.000 -.3243887 -.1311219 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ Level 2: school | var(gcseavnormal_12345) | .1813545 .0781101 .0282616 .3344475 cov(gcseav~12345,female_12345)| .037437 .0864648 -.1320309 .206905 var(female_12345) | .3247212 .1865771 -.0409631 .6904055 cov(gcseav~12345,cons_12345) | .014737 .0752339 -.1327188 .1621928 cov(female_12345,cons_12345) | -.0514419 .1277556 -.3018384 .1989545 var(cons_12345) | .6633044 .1450018 .3791061 .9475027 ------------------------------------------------------------------------------ . . . . * Chapter learning outcomes . . . . . . . . . . . . . . . . . . . . . . .180 . . . . **************************************************************************** . exit end of do-file