### Mplus Textbook Examples Multilevel Analysis by Tom Snijders and Roel Bosker Chapter 14: Discrete Dependent Variables

Table 14.1 on page 214, intercept only model. Since there is no within variance at level-1, there is no within statement in this model.
  Title: multilevel logistic regression
Data:
File is ch14_1.dat ;
Variable:
Names are
respnr ltbm eltwm sex age edu relserv class reg cohab;
Missing are all (-9999) ;
usevar are cohab reg;
categorical is cohab;
cluster is reg;
Analysis:
Type = twolevel random  ;
model:
%between%
cohab;
TESTS OF MODEL FIT
Loglikelihood
          H0 Value                       -1420.493
Information Criteria
          Number of Free Parameters              2
Akaike (AIC)                    2844.986
Bayesian (BIC)                  2856.266
(n* = (n + 2) / 24)


MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level

Between Level
 Thresholds
COHAB$1 0.278 0.062 4.442  Variances COHAB 0.032 0.019 1.635 Table 14.2 on page 217, model 1.  Title: multilevel logistic regression Data: File is ch14_1.dat ; Variable: Names are respnr ltbm eltwm sex age edu relserv class reg cohab; Missing are all (-9999) ; usevar are cohab reg agec agec2 age3 age4 ; within are agec agec2 age3 age4 ; categorical is cohab; cluster is reg; Define: agec = age - 20; agec2 = (age-20)**2; IF (age>30) THEN age3 = (age-30)**2; IF (age <=30) THEN age3 = 0; IF (age > 40) THEN age4 = (age-40)**2; IF (age <=40) THEN age4 = 0;  Analysis: Type = twolevel random ; model: %within% cohab on agec agec2 age3 age4 ; %between% cohab; TESTS OF MODEL FIT Loglikelihood  H0 Value -1123.849 Information Criteria  Number of Free Parameters 6 Akaike (AIC) 2259.697 Bayesian (BIC) 2293.535 Sample-Size Adjusted BIC 2274.473 (n* = (n + 2) / 24)  MODEL RESULTS  Estimates S.E. Est./S.E. Within Level  COHAB ON AGEC 0.545 0.044 12.408 AGEC2 -0.029 0.003 -8.800 AGE3 0.024 0.005 4.760 AGE4 0.007 0.002 3.150  Between Level  Thresholds COHAB$1            1.214    0.157      7.755
 Variances
COHAB              0.063    0.024      2.605

Table 14.2 on page 217, model 2.

  Title: multilevel logistic regression
Data:
File is ch14_1.dat ;
Variable:
Names are
respnr ltbm eltwm sex age edu relserv class reg cohab;
Missing are all (-9999) ;
usevar are cohab reg  agec agec2 age3 age4 religion;
within are agec agec2 age3 age4 religion;
categorical is cohab;
cluster is reg;
Define:
agec = age - 20;
agec2 = (age-20)**2;
IF (age>30) THEN age3 = (age-30)**2;
IF (age <=30) THEN age3 = 0;
IF (age > 40) THEN age4 = (age-40)**2;
IF (age <=40) THEN age4 = 0;
IF (relserv <3.5) THEN religion = 1;
if (relserv >=3.5) THEN religion = 0;
Analysis:
Type = twolevel random  ;
model:
%within%
cohab on agec agec2 age3 age4 religion;
%between%
cohab;
TESTS OF MODEL FIT
Loglikelihood
          H0 Value                       -1085.620
Information Criteria
          Number of Free Parameters              7
Akaike (AIC)                    2185.240
Bayesian (BIC)                  2224.717
(n* = (n + 2) / 24)


MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level
 COHAB      ON
AGEC               0.549    0.044     12.338
AGEC2             -0.029    0.003     -8.409
AGE3               0.024    0.005      4.388
AGE4               0.008    0.002      3.243
RELIGION          -1.870    0.224     -8.344

Between Level
 Thresholds
COHAB\$1            1.117    0.154      7.262
 Variances
COHAB              0.051    0.025      2.070

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.