UCLA Academic Technology Services HomeServicesClassesContactJobs

Mplus Textbook Examples
Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence
by Judith D. Singer and John B. Willett
Chapter 11:  Fitting basic discrete-time hazard models

Table 11.3 on page 386 using firstsex_wide.dat.

Model A:

Title: 
    Model A
Data:
  File is d:\alda\firstsex_wide.dat ;
Variable:
  Names are 
     id event7 event8 event9 event10 event11 event12 pt pas;
  Missing are all (-9999) ;
  usev are event7-event12;
  classes =c(1);
  categorical are event7-event12; 
Analysis: 
  Type = mixture missing;
model:
%overall%
%c#1%
[event7$1*0 event8$1*0 event9$1*0 event10$1*0
 event11$1*0 event12$1*0];

Notice that the deviance is -2*Loglikelihood. That is -2*(-325.978) = 651.956. The threshold estimates in the output are just negative of the parameter estimates in the book.

TESTS OF MODEL FIT
Loglikelihood
          H0 Value                        -325.978
Information Criteria
          Number of Free Parameters              6
          Akaike (AIC)                     663.955
          Bayesian (BIC)                   683.113
          Sample-Size Adjusted BIC         664.111
            (n* = (n + 2) / 24)
Chi-Square Test of Model Fit for the Latent Class Indicator Model Part
          Pearson Chi-Square
          Value                              0.000
          Degrees of Freedom                    57
          P-Value                           1.0000
          Likelihood Ratio Chi-Square
          Value                              0.000
          Degrees of Freedom                    57
          P-Value                           1.0000
Chi-Square Test for MCAR under the Unrestricted Latent Class Indicator Model
          Pearson Chi-Square
          Value                            687.133
          Degrees of Freedom                    57
          P-Value                           0.0000
          Likelihood Ratio Chi-Square
          Value                            551.062
          Degrees of Freedom                    57
          P-Value                           0.0000

FINAL CLASS COUNTS AND PROPORTIONS OF TOTAL SAMPLE SIZE
BASED ON ESTIMATED POSTERIOR PROBABILITIES
  Class 1        180.00000          1.00000
CLASSIFICATION OF INDIVIDUALS BASED ON THEIR MOST LIKELY CLASS MEMBERSHIP
Class Counts and Proportions
  Class 1              180          1.00000
Average Class Probabilities by Class
                 1
  Class 1     1.000
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
CLASS 1
LATENT CLASS INDICATOR MODEL PART
 Class 1
 Thresholds
    EVENT7$1           2.398    0.270      8.892
    EVENT8$1           3.117    0.386      8.069
    EVENT9$1           1.720    0.222      7.759
    EVENT10$1          1.287    0.210      6.133
    EVENT11$1          1.163    0.229      5.076
    EVENT12$1          0.731    0.239      3.062
LATENT CLASS INDICATOR MODEL PART IN PROBABILITY SCALE
 Class 1
 EVENT7
    Category 1         0.917    0.021     44.497
    Category 2         0.083    0.021      4.045
 EVENT8
    Category 1         0.958    0.016     61.027
    Category 2         0.042    0.016      2.704
 EVENT9
    Category 1         0.848    0.029     29.701
    Category 2         0.152    0.029      5.320
 EVENT10
    Category 1         0.784    0.036     22.027
    Category 2         0.216    0.036      6.084
 EVENT11
    Category 1         0.762    0.042     18.330
    Category 2         0.238    0.042      5.728
 EVENT12
    Category 1         0.675    0.052     12.890
    Category 2         0.325    0.052      6.206

Model B:

Title: 
    Model B
Data:
  File is d:\alda\firstsex_wide.dat ;
Variable:
  Names are 
     id event7 event8 event9 event10 event11 event12 pt pas;
  Missing are all (-9999) ;
  usev are event7-event12 pt;
  classes =c(1);
  categorical are event7-event12; 
Analysis: 
  Type = mixture missing;
model:
%overall%
  event7 - event12 on pt (1);
%c#1%
[event7$1*0 event8$1*0 event9$1*0 event10$1*0
 event11$1*0 event12$1*0];

The calculation of deviance is the same as shown in the previous example: -2*(-317.331) = 634.662.

TESTS OF MODEL FIT
Loglikelihood
          H0 Value                        -317.331
Information Criteria
          Number of Free Parameters              7
          Akaike (AIC)                     648.662
          Bayesian (BIC)                   671.012
          Sample-Size Adjusted BIC         648.843
            (n* = (n + 2) / 24)

FINAL CLASS COUNTS AND PROPORTIONS OF TOTAL SAMPLE SIZE
BASED ON ESTIMATED POSTERIOR PROBABILITIES
  Class 1        180.00000          1.00000
CLASSIFICATION OF INDIVIDUALS BASED ON THEIR MOST LIKELY CLASS MEMBERSHIP
Class Counts and Proportions
  Class 1              180          1.00000
Average Class Probabilities by Class
                 1
  Class 1     1.000
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
CLASS 1
LATENT CLASS INDICATOR MODEL PART
 Class 1
 Thresholds
    EVENT7$1           2.994    0.305      9.832
    EVENT8$1           3.700    0.424      8.726
    EVENT9$1           2.281    0.281      8.110
    EVENT10$1          1.823    0.258      7.078
    EVENT11$1          1.654    0.276      5.997
    EVENT12$1          1.179    0.270      4.372
 EVENT7   ON
    PT                 0.874    0.217      4.024
 EVENT8   ON
    PT                 0.874    0.217      4.024
 EVENT9   ON
    PT                 0.874    0.217      4.024
 EVENT10  ON
    PT                 0.874    0.217      4.024
 EVENT11  ON
    PT                 0.874    0.217      4.024
 EVENT12  ON
    PT                 0.874    0.217      4.024

Model C:

Title: 
    Model C
Data:
  File is d:\firstsex_wide.dat ;
Variable:
  Names are 
     id event7 event8 event9 event10 event11 event12 pt pas;
  Missing are all (-9999) ;
  usev are event7-event12 pas;
  classes =c(1);
  categorical are event7-event12; 
Analysis: 
  Type = mixture missing;
model:
%overall%
  event7 - event12 on pas (1);
%c#1%
[event7$1*0 event8$1*0 event9$1*0 event10$1*0
 event11$1*0 event12$1*0];

The deviance is -2*(-318.584) = 637.168.

TESTS OF MODEL FIT
Loglikelihood
          H0 Value                        -318.584
Information Criteria
          Number of Free Parameters              7
          Akaike (AIC)                     651.169
          Bayesian (BIC)                   673.519
          Sample-Size Adjusted BIC         651.350
            (n* = (n + 2) / 24)

FINAL CLASS COUNTS AND PROPORTIONS OF TOTAL SAMPLE SIZE
BASED ON ESTIMATED POSTERIOR PROBABILITIES
  Class 1        180.00000          1.00000
CLASSIFICATION OF INDIVIDUALS BASED ON THEIR MOST LIKELY CLASS MEMBERSHIP
Class Counts and Proportions
  Class 1              180          1.00000
Average Class Probabilities by Class
                 1
  Class 1     1.000
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
CLASS 1
LATENT CLASS INDICATOR MODEL PART
 Class 1
 Thresholds
    EVENT7$1           2.465    0.266      9.262
    EVENT8$1           3.159    0.386      8.176
    EVENT9$1           1.730    0.230      7.516
    EVENT10$1          1.285    0.214      5.993
    EVENT11$1          1.136    0.230      4.934
    EVENT12$1          0.642    0.239      2.687
 EVENT7   ON
    PAS                0.443    0.109      4.066
 EVENT8   ON
    PAS                0.443    0.109      4.066
 EVENT9   ON
    PAS                0.443    0.109      4.066
 EVENT10  ON
    PAS                0.443    0.109      4.066
 EVENT11  ON
    PAS                0.443    0.109      4.066
 EVENT12  ON
    PAS                0.443    0.109      4.066

Model D:

Title: 
    Model D
Data:
  File is d:\alda\firstsex_wide.dat ;
Variable:
  Names are 
     id event7 event8 event9 event10 event11 event12 pt pas;
  Missing are all (-9999) ;
  usev are event7-event12 pt pas;
  classes =c(1);
  categorical are event7-event12; 
Analysis: 
  Type = mixture missing;
model:
%overall%
  event7 - event12 on pt (1);
  event7 - event12 on pas (2);
%c#1%
[event7$1*0 event8$1*0 event9$1*0 event10$1*0
 event11$1*0 event12$1*0];

The deviance is -2*(-314.573) = 629.146.

TESTS OF MODEL FIT
Loglikelihood
          H0 Value                        -314.573
Information Criteria
          Number of Free Parameters              8
          Akaike (AIC)                     645.147
          Bayesian (BIC)                   670.691
          Sample-Size Adjusted BIC         645.355
            (n* = (n + 2) / 24)

FINAL CLASS COUNTS AND PROPORTIONS OF TOTAL SAMPLE SIZE
BASED ON ESTIMATED POSTERIOR PROBABILITIES
  Class 1        180.00000          1.00000
CLASSIFICATION OF INDIVIDUALS BASED ON THEIR MOST LIKELY CLASS MEMBERSHIP
Class Counts and Proportions
  Class 1              180          1.00000
Average Class Probabilities by Class
                 1
  Class 1     1.000
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
CLASS 1
LATENT CLASS INDICATOR MODEL PART
 Class 1
 Thresholds
    EVENT7$1           2.893    0.309      9.359
    EVENT8$1           3.585    0.427      8.397
    EVENT9$1           2.150    0.284      7.562
    EVENT10$1          1.693    0.265      6.398
    EVENT11$1          1.518    0.281      5.398
    EVENT12$1          1.010    0.275      3.669
 EVENT7   ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479
 EVENT8   ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479
 EVENT9   ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479
 EVENT10  ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479
 EVENT11  ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479
 EVENT12  ON
    PT                 0.661    0.237      2.788
    PAS                0.296    0.120      2.479

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


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.