UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

Mplus Textbook Examples
Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence
by Judith D. Singer and John B. Willett
Chapter 5: Treating time more flexibly


Table 5.2, page 145

Table 5.2 uses data file reading.dat. Note the format of this file, that it is in wide form.  Here is a display of the first 10 observations.

. list  id  cage1 cage2 cage3 cagegrp1 cagegrp2 cagegrp3 piat1 piat2 piat3

+-----------------------------------------------------------------------------------------------+
| id       cage1      cage2      cage3   cagegrp1   cagegrp2   cagegrp3   piat1   piat2   piat3 |
|-----------------------------------------------------------------------------------------------|
|  1         -.5   1.833333   3.833333          0          2          4      18      35      59 |
|  2         -.5          2   4.083333          0          2          4      18      25      28 |
|  3   -.4166665   1.916667   3.916667          0          2          4      18      23      32 |
|  4         -.5          2   4.166667          0          2          4      18      31      50 |
|  5         -.5   1.666667       3.75          0          2          4      18      33      53 |
|-----------------------------------------------------------------------------------------------|
|  6         -.5          2          4          0          2          4      18      28      31 |
|  7   -.4166665          2          4          0          2          4      17      28      28 |
|  8         -.5   1.916667   4.083333          0          2          4      17      29      41 |
|  9   -.3333335       2.25   4.333333          0          2          4      28      26      26 |
| 10   -.3333335   1.916667   3.916667          0          2          4      16      20      21 |
|-----------------------------------------------------------------------------------------------|

Model A: Using AGEGRPi-6.5 as a temporal predictor, called cagegrpi (i.e., cagegrp1 cagegrp2 cagegrp3).  These were created before making the data file.

Title: 
  Table 5.2, Model A.
Data:  
  File is c:\alda\reading.dat ;
Variable: 
  Names are 
     id agegrp1 agegrp2 agegrp3 age1 age2 age3 piat1 piat2 piat3 cage1
     cage2 cage3 cagegrp1 cagegrp2 cagegrp3;
  Missing are all (-999999999) ; 
  Usevariables are
     piat1 piat2 piat3 cagegrp1 cagegrp2 cagegrp3;
  Tscores cagegrp1-cagegrp3 ;
Analysis: 
  Type = random ;
  estimator = ml;
Model:
  i s | piat1-piat3 at cagegrp1-cagegrp3 ;
  i with s;
  piat1-piat3 (1) ;
------------------------------------------------------------------------------------------------
TESTS OF MODEL FIT
Loglikelihood
          H0 Value                        -909.978
Information Criteria
          Number of Free Parameters              6
          Akaike (AIC)                    1831.956
          Bayesian (BIC)                  1846.888
          Sample-Size Adjusted BIC        1827.953
            (n* = (n + 2) / 24)
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
 I        WITH
    S                  1.567    2.070      0.757
 Means
    I                 21.133    0.617     34.273
    S                  5.039    0.295     17.065
 Intercepts
    PIAT1              0.000    0.000      0.000
    PIAT2              0.000    0.000      0.000
    PIAT3              0.000    0.000      0.000
 Variances
    I                 11.368    6.115      1.859
    S                  4.388    1.265      3.470
 Residual Variances
    PIAT1             26.961    4.029      6.691
    PIAT2             26.961    4.029      6.691
    PIAT3             26.961    4.029      6.691

Note that the residual variances are constrained to be equal.  See the Supplemental Analyses for Chapter 5 to see an example where the residual variances a permitted to freely vary.


Model B: Using AGE-6.5 as a temporal predictor, i.e., cage1 cage2 cage3.

Title: 
Data:
  File is c:\alda\reading.dat ;
Variable:
  Names are 
     id agegrp1 agegrp2 agegrp3 age1 age2 age3 piat1 piat2 piat3 cage1
     cage2 cage3 cagegrp1 cagegrp2 cagegrp3;
  Missing are all (-999999999) ; 
  Usevariables are
     piat1 piat2 piat3 cage1 cage2 cage3;
  Tscores cage1-cage3 ;
Analysis: 
  Type = random;
  estimator = ml;
MODEL:
  i s | piat1-piat3 at cage1-cage3 ;
  i with s;
  piat1-piat3 (1) ;
------------------------------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood
          H0 Value                        -901.960
Information Criteria
          Number of Free Parameters              6
          Akaike (AIC)                    1815.920
          Bayesian (BIC)                  1830.851
          Sample-Size Adjusted BIC        1811.916
            (n* = (n + 2) / 24)

MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
 I        WITH
    S                  2.139    1.814      1.179
 Means
    I                 21.033    0.564     37.285
    S                  4.549    0.262     17.397
 Intercepts
    PIAT1              0.000    0.000      0.000
    PIAT2              0.000    0.000      0.000
    PIAT3              0.000    0.000      0.000
 Variances
    I                  5.910    6.045      0.978
    S                  3.384    1.019      3.321
 Residual Variances
    PIAT1             27.009    4.232      6.382
    PIAT2             27.009    4.232      6.382
    PIAT3             27.009    4.232      6.382

Table 5.4, page 149, using the ALDACh5Table5.4.txt data

We thank Hemant Kher for providing the Mplus code for this example.

Model A

Title:  Table 5.4, Model A, Person (wide) file
Data: 
   File is "C:\alda\ALDACh5Table5.4.txt";
Variable: 
   Names are id exp1-exp13 lnw1-lnw13 black hgc_9;
  Missing are all (-999) ;
   Usevariables are exp1-exp13 lnw1-lnw13;
   Tscores exp1-exp13;
Analysis:
  Type = random;
  estimator = ml;
MODEL:
  i s | lnw1-lnw13 at exp1-exp13;
  i with s;
  lnw1-lnw13 (1) ;
-----------------------------------------------------------------------------
MODEL FIT INFORMATION

Number of Free Parameters                        6

Loglikelihood

          H0 Value                       -2460.697

Information Criteria

          Akaike (AIC)                    4933.394
          Bayesian (BIC)                  4962.128
          Sample-Size Adjusted BIC        4943.073
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

 I        WITH
    S                 -0.003      0.001     -3.354      0.001

 Means
    I                  1.716      0.011    158.792      0.000
    S                  0.046      0.002     19.461      0.000

 Intercepts
    LNW1               0.000      0.000    999.000    999.000
    LNW2               0.000      0.000    999.000    999.000
    LNW3               0.000      0.000    999.000    999.000
    LNW4               0.000      0.000    999.000    999.000
    LNW5               0.000      0.000    999.000    999.000
    LNW6               0.000      0.000    999.000    999.000
    LNW7               0.000      0.000    999.000    999.000
    LNW8               0.000      0.000    999.000    999.000
    LNW9               0.000      0.000    999.000    999.000
    LNW10              0.000      0.000    999.000    999.000
    LNW11              0.000      0.000    999.000    999.000
    LNW12              0.000      0.000    999.000    999.000
    LNW13              0.000      0.000    999.000    999.000

 Variances
    I                  0.054      0.005     10.851      0.000
    S                  0.002      0.000      7.845      0.000

 Residual Variances
    LNW1               0.095      0.002     48.916      0.000
    LNW2               0.095      0.002     48.916      0.000
    LNW3               0.095      0.002     48.916      0.000
    LNW4               0.095      0.002     48.916      0.000
    LNW5               0.095      0.002     48.916      0.000
    LNW6               0.095      0.002     48.916      0.000
    LNW7               0.095      0.002     48.916      0.000
    LNW8               0.095      0.002     48.916      0.000
    LNW9               0.095      0.002     48.916      0.000
    LNW10              0.095      0.002     48.916      0.000
    LNW11              0.095      0.002     48.916      0.000
    LNW12              0.095      0.002     48.916      0.000
    LNW13              0.095      0.002     48.916      0.000

Model B

Title:
   Table 5.4, Model B, Person (wide) file
Data:
   File is "E:\sandwmplus\ALDACh5Table5.4.txt";
Variable:
  Names are
     id exp1-exp13 lnw1-lnw13 black hgc_9;
  Missing are all (-999) ;
  Usevariables are
     exp1-exp13 lnw1-lnw13 black hgc_9;
  Tscores exp1-exp13;
Analysis:
  Type = random;
  estimator = ml;
MODEL:
  i s | lnw1-lnw13 at exp1-exp13;
  i with s;
  i on black hgc_9;
  s on black hgc_9;
  lnw1-lnw13 (1);
-----------------------------------------------------------------------------
MODEL FIT INFORMATION

Number of Free Parameters                       10

Loglikelihood

          H0 Value                       -2436.876

Information Criteria

          Akaike (AIC)                    4893.751
          Bayesian (BIC)                  4941.641
          Sample-Size Adjusted BIC        4909.883
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

 I          ON
    BLACK              0.015      0.024      0.643      0.520
    HGC_9              0.035      0.008      4.430      0.000

 S          ON
    BLACK             -0.018      0.005     -3.312      0.001
    HGC_9              0.001      0.002      0.742      0.458

 I        WITH
    S                 -0.003      0.001     -3.378      0.001

 Intercepts
    LNW1               0.000      0.000    999.000    999.000
    LNW2               0.000      0.000    999.000    999.000
    LNW3               0.000      0.000    999.000    999.000
    LNW4               0.000      0.000    999.000    999.000
    LNW5               0.000      0.000    999.000    999.000
    LNW6               0.000      0.000    999.000    999.000
    LNW7               0.000      0.000    999.000    999.000
    LNW8               0.000      0.000    999.000    999.000
    LNW9               0.000      0.000    999.000    999.000
    LNW10              0.000      0.000    999.000    999.000
    LNW11              0.000      0.000    999.000    999.000
    LNW12              0.000      0.000    999.000    999.000
    LNW13              0.000      0.000    999.000    999.000
    I                  1.717      0.013    136.842      0.000
    S                  0.049      0.003     18.722      0.000

 Residual Variances
    LNW1               0.095      0.002     48.913      0.000
    LNW2               0.095      0.002     48.913      0.000
    LNW3               0.095      0.002     48.913      0.000
    LNW4               0.095      0.002     48.913      0.000
    LNW5               0.095      0.002     48.913      0.000
    LNW6               0.095      0.002     48.913      0.000
    LNW7               0.095      0.002     48.913      0.000
    LNW8               0.095      0.002     48.913      0.000
    LNW9               0.095      0.002     48.913      0.000
    LNW10              0.095      0.002     48.913      0.000
    LNW11              0.095      0.002     48.913      0.000
    LNW12              0.095      0.002     48.913      0.000
    LNW13              0.095      0.002     48.913      0.000
    I                  0.052      0.005     10.629      0.000
    S                  0.002      0.000      7.648      0.000

Model C

Title:
  Table 5.4, Model A, Person (wide) file
Data:
  File is "E:\sandwmplus\ALDACh5Table5.4.txt";
Variable:
  Names are
     id exp1-exp13 lnw1-lnw13 black hgc_9;
  Missing are all (-999) ;
  Usevariables are
     exp1-exp13 lnw1-lnw13 black hgc_9;
  Tscores exp1-exp13;
Analysis:
  Type = random;
  estimator = ml;
MODEL:
  i s | lnw1-lnw13 at exp1-exp13;
  i with s;
  i on hgc_9;
  s on black;
  lnw1-lnw13 (1);
-----------------------------------------------------------------------------
MODEL FIT INFORMATION

Number of Free Parameters                        8

Loglikelihood

          H0 Value                       -2437.352

Information Criteria

          Akaike (AIC)                    4890.704
          Bayesian (BIC)                  4929.015
          Sample-Size Adjusted BIC        4903.609
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

 I          ON
    HGC_9              0.038      0.006      5.961      0.000

 S          ON
    BLACK             -0.016      0.005     -3.572      0.000

 I        WITH
    S                 -0.003      0.001     -3.406      0.001

 Intercepts
    LNW1               0.000      0.000    999.000    999.000
    LNW2               0.000      0.000    999.000    999.000
    LNW3               0.000      0.000    999.000    999.000
    LNW4               0.000      0.000    999.000    999.000
    LNW5               0.000      0.000    999.000    999.000
    LNW6               0.000      0.000    999.000    999.000
    LNW7               0.000      0.000    999.000    999.000
    LNW8               0.000      0.000    999.000    999.000
    LNW9               0.000      0.000    999.000    999.000
    LNW10              0.000      0.000    999.000    999.000
    LNW11              0.000      0.000    999.000    999.000
    LNW12              0.000      0.000    999.000    999.000
    LNW13              0.000      0.000    999.000    999.000
    I                  1.721      0.011    160.860      0.000
    S                  0.049      0.003     19.416      0.000

 Residual Variances
    LNW1               0.095      0.002     48.925      0.000
    LNW2               0.095      0.002     48.925      0.000
    LNW3               0.095      0.002     48.925      0.000
    LNW4               0.095      0.002     48.925      0.000
    LNW5               0.095      0.002     48.925      0.000
    LNW6               0.095      0.002     48.925      0.000
    LNW7               0.095      0.002     48.925      0.000
    LNW8               0.095      0.002     48.925      0.000
    LNW9               0.095      0.002     48.925      0.000
    LNW10              0.095      0.002     48.925      0.000
    LNW11              0.095      0.002     48.925      0.000
    LNW12              0.095      0.002     48.925      0.000
    LNW13              0.095      0.002     48.925      0.000
    I                  0.052      0.005     10.636      0.000
    S                  0.002      0.000      7.691      0.000

Table 5.7, page 163

Model A: Initial growth model, using Person (wide) unemp.dat data file.

Title: 
  Table 5.7, Model A, Person (wide) file
Data:
  File is c:\alda\unemp.dat ;
Variable:
  Names are 
     id cesd1 cesd2 cesd3 months1 months2 months3 unemp1 unemp2 unemp3
     ubym1 ubym2 ubym3;
  Missing are all (-999999999) ; 
  Usevariables are
     cesd1 cesd2 cesd3 months1 months2 months3 ;
  Tscores months1-months3 ;
Analysis: 
  Type = random;
  estimator = ml;
MODEL:
  i s | cesd1-cesd3 at months1-months3 ;
  i with s;
  cesd1-cesd3 (1) ;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood
          H0 Value                       -2189.403
Information Criteria
          Number of Free Parameters              6
          Akaike (AIC)                    4390.806
          Bayesian (BIC)                  4410.382
          Sample-Size Adjusted BIC        4391.375
            (n* = (n + 2) / 24)
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
 I        WITH
    S                 -2.335    1.329     -1.757
 Means
    I                 17.187    0.845     20.332
    S                 -0.387    0.085     -4.533
 Variances
    I                 78.573   15.179      5.176
    S                  0.325    0.176      1.850
 Residual Variances
    CESD1             66.008    6.574     10.041
    CESD2             66.008    6.574     10.041
    CESD3             66.008    6.574     10.041

Model A (again): Initial growth model, using person period ("long") unemp_pp.dat data file.

Title: 
  Table 5.7, Model A, Person Period (long) file
Data:
  File is c:\alda\unemp_pp.dat ;
Variable:
  Names are 
     id months cesd unemp;
  Missing are all (-999999999) ; 
  Usevariables are
     months cesd ;
     cluster = id;
     within = months ;
Analysis: 
  Type = random twolevel ;
  mconvergence = .000001;
  estimator = ml;
model:
  %within%
    s | cesd on months;
  %between%
    cesd with s;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood
          H0 Value                       -2566.569
Information Criteria
          Number of Free Parameters              6
          Akaike (AIC)                    5145.137
          Bayesian (BIC)                  5172.217
          Sample-Size Adjusted BIC        5153.166
            (n* = (n + 2) / 24)
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level
 Residual Variances
    CESD              68.848    6.602     10.428
Between Level
 CESD     WITH
    S                 -3.058    1.385     -2.208
 Means
    CESD              17.669    0.776     22.782
    S                 -0.422    0.083     -5.083
 Variances
    CESD              86.852   14.963      5.804
    S                  0.355    0.184      1.925

Model B: Main effect of unemployment using person period ("long") unemp_pp.dat data file.

Title: 
  Table 5.7, Model B, Person Period (long) file
Data:
  File is c:\alda\unemp_pp.dat ;
Variable:
  Names are 
     id months cesd unemp;
  Missing are all (-999999999) ; 
  Usevariables are
     months cesd unemp;
     cluster = id;
     within = months unemp;
Analysis: 
  Type = random missing twolevel ;
  mconvergence = .000001;
  estimator = ml;

model:

  %within%
    cesd on unemp;
    s | cesd on months;
  %between%
    cesd with s;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood
          H0 Value                       -2553.802
Information Criteria
          Number of Free Parameters              7
          Akaike (AIC)                    5121.603
          Bayesian (BIC)                  5153.196
          Sample-Size Adjusted BIC        5130.970
            (n* = (n + 2) / 24)

MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level
 CESD     ON
    UNEMP              5.111    0.996      5.133
 Residual Variances
    CESD              62.388    6.013     10.375
Between Level
 CESD     WITH
    S                 -3.894    1.370     -2.842
 Means
    CESD              12.666    1.247     10.157
    S                 -0.202    0.093     -2.163
 Variances
    CESD              93.518   14.820      6.310
    S                  0.465    0.180      2.585

Model C: Effect of unemployment on initial status and growth rate.

Title: 
  Table 5.7, Model C, Person Period (long) file
Data:
  File is C:\alda\unemployment_pp.dat ;
Define:
  monBYun = months * unemp;
Variable:
  Names are 
     id months cesd unemp;
  Missing are all (-999999999) ; 
  Usevariables are
     months cesd unemp monBYun;
     cluster = id;
     within = months unemp monBYun;
Analysis: 
  Type = random missing twolevel ;
  mconvergence = .000001;
  estimator = ml;
model:
  %within%
    cesd on unemp monBYun;
    s | cesd on months;
  %between%
    cesd with s;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood
          H0 Value                       -2551.523
Information Criteria
          Number of Free Parameters              8
          Akaike (AIC)                    5119.047
          Bayesian (BIC)                  5155.153
          Sample-Size Adjusted BIC        5129.752
            (n* = (n + 2) / 24)

MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level
 CESD     ON
    UNEMP              8.529    1.880      4.538
    MONBYUN           -0.465    0.217     -2.140
 Residual Variances
    CESD              62.031    5.966     10.398
Between Level
 CESD     WITH
    S                 -3.873    1.359     -2.850
 Means
    CESD               9.617    1.891      5.086
    S                  0.162    0.194      0.836
 Variances
    CESD              93.712   14.777      6.342
    S                  0.451    0.177      2.544

Model D: Allowing unemployment to have both fix and random effects.

We thank Hemant Kher for providing the Mplus code for this example.

NOTE:  The results obtained from Mplus do not match those shown in the text.  Regarding these differences, Professor Bengt Muthen says:

"Notice that there are some numerical issues with the model - the variance-covariance matrix of the random effects is singular. Just a little more information about Mplus. If you add the technical option output:tech8; you will see the details of the convergence process. The default algorithm EMA quickly reaches the ML estimates but fails because the variance covariance matrix for the random effects is singular. At that point Mplus switches to the EM algorithm which slowly approaches the singularity, but Mplus will deliberately avoid the full convergence to avoid the singularity. In this part of the algorithm the solution is driven by the logcriterion convergence criterion. So essentially all software packages differ because the ML solution is inadmissible, so they report their own version of "approximately" ML solution."

Title:
  Table 5.7, Model D, Person Period (long) file
  Unemp and Unemp*Months (monBYun) have fixed
  as well as random effects
Data:
  File is "C:\alda\unemployment_pp.dat";
Define:
  monBYun = months * unemp;
Variable:
  Names are
     id months cesd unemp;
  Missing are all (-999999999) ;
  Usevariables are
     cesd unemp monBYun;
     cluster = id;
     within = unemp monBYun;
Analysis:
  Type = random missing twolevel ;
  logcriterion=0.0000001; miter=10000;
  estimator = ml;
model:
  %within%
  s1 | cesd on unemp;
  s2 | cesd on monBYun;

  %between%
  cesd with s1;
  cesd with s2;
  s1 with s2;
output: sampstat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -2547.651

Information Criteria

          Number of Free Parameters             10
          Akaike (AIC)                    5115.302
          Bayesian (BIC)                  5160.434
          Sample-Size Adjusted BIC        5128.683
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 Residual Variances
    CESD              59.013      6.030      9.787      0.000

Between Level

 CESD     WITH
    S1                 6.539     11.457      0.571      0.568
    S2                 0.647      2.252      0.287      0.774

 S1       WITH
    S2                -5.625      2.656     -2.118      0.034

 Means
    CESD              11.195      0.795     14.080      0.000
    S1                 6.927      0.933      7.421      0.000
    S2                -0.303      0.114     -2.668      0.008

 Variances
    CESD              45.261     12.558      3.604      0.000
    S1                44.973     21.099      2.132      0.033
    S2                 0.754      0.264      2.859      0.004

Table 5.8, page 175 using ALDACh5Table5.8.txt

We thank Hemant Kher for providing the Mplus code for this example.

Model A: Centered at 7.

Title:
    Table 5.8, Model A, Person Period (long) file
Data:
  File is "C:\alda\ALDACh5Table5.8.txt";
Define:
  uerate7 = uerate-7;
  hgc_9=hgc-9;
Variable:
  Names are
     id lnw exper black hgc uerate ue_c1 ue_mean ue_p_c ue1;
  Usevariables are
     lnw exper black uerate7 hgc_9;
     cluster = id;
     within = exper uerate7 hgc_9;
     between = black;
Analysis:
  Type = random missing twolevel ;
  mconv=0.0000001;
  estimator = ml;
model:
  %within%
  lnw on hgc_9 uerate7;
  s | lnw on exper;
  %between%
  lnw with s;
  s on black;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -2415.260

Information Criteria

          Number of Free Parameters              9
          Akaike (AIC)                    4848.519
          Bayesian (BIC)                  4909.398
          Sample-Size Adjusted BIC        4880.799
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 LNW        ON
    HGC_9              0.040      0.006      6.287      0.000
    UERATE7           -0.012      0.002     -6.663      0.000

 Residual Variances
    LNW                0.095      0.002     48.909      0.000

Between Level

 S          ON
    BLACK             -0.018      0.004     -4.055      0.000

 LNW      WITH
    S                 -0.003      0.001     -3.474      0.001

 Means
    LNW                1.749      0.011    153.413      0.000

 Intercepts
    S                  0.044      0.003     16.907      0.000

 Variances
    LNW                0.051      0.005     10.531      0.000

 Residual Variances
    S                  0.002      0.000      7.676      0.000

Model B: Within-person centering.

Title:
  Table 5.8, Model B, Person Period (long) file

Data:
  File is "C:\alda\ALDACh5Table5.8.txt";

Variable:
  Names are
  id lnw exper black hgc uerate ue_c1 ue_mean ue_p_c ue1;
! Note: ue_mean=person's mean uerate
! Note: ue_p_c =uerate centered around the person's mean uerate

  Usevariables are
     lnw exper black ue_mean ue_p_c hgc_9;
     cluster = id;
     within = exper ue_mean ue_p_c hgc_9;
     between = black;

Define:
  hgc_9=hgc-9;

Analysis:
  Type = random twolevel ;
  mconv=0.0000001;
  estimator = ml;

model:
  %within%
  lnw on hgc_9 ue_mean ue_p_c;
  s | lnw on exper;
  %between%
  lnw with s;
  s on black;

output: sampstat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -2413.489

Information Criteria

          Number of Free Parameters             10
          Akaike (AIC)                    4846.978
          Bayesian (BIC)                  4914.622
          Sample-Size Adjusted BIC        4882.845
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 LNW        ON
    HGC_9              0.040      0.006      6.323      0.000
    UE_MEAN           -0.018      0.004     -4.999      0.000
    UE_P_C            -0.010      0.002     -4.719      0.000

 Residual Variances
    LNW                0.095      0.002     48.907      0.000

Between Level

 S          ON
    BLACK             -0.019      0.004     -4.214      0.000

 LNW      WITH
    S                 -0.003      0.001     -3.588      0.000

 Means
    LNW                1.874      0.030     63.194      0.000

 Intercepts
    S                  0.045      0.003     16.971      0.000

 Variances
    LNW                0.051      0.005     10.537      0.000

 Residual Variances
    S                  0.002      0.000      7.673      0.000

Model C: Time-1 centered.

Title:
    Table 5.8, Model C, Person Period (long) file

Data:
  File is "C:\alda\ALDACh5Table5.8.txt";

Variable:
  Names are
  id lnw exper black hgc uerate ue_c1 ue_mean ue_p_c ue1;
! Note: ue_c1  =uerate centered around the person's 1st value of uerate
! Note: ue1    =the first uerate value for the person

  Usevariables are
     lnw exper black ue1 ue_c1 hgc_9;
     cluster = id;
     within = exper ue1 ue_c1 hgc_9;
     between = black;

Define:
  hgc_9=hgc-9;

Analysis:
  Type = random twolevel ;
  mconv=0.0000001;
  estimator = ml;

Model:
  %within%
  lnw on hgc_9 ue1 ue_c1;
  s | lnw on exper;

  %between%
  lnw with s;
  s on black;

Output: sampstat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -2412.921

Information Criteria

          Number of Free Parameters             10
          Akaike (AIC)                    4845.842
          Bayesian (BIC)                  4913.485
          Sample-Size Adjusted BIC        4881.708
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 LNW        ON
    HGC_9              0.040      0.006      6.287      0.000
    UE1               -0.016      0.003     -6.107      0.000
    UE_C1             -0.010      0.002     -5.294      0.000

 Residual Variances
    LNW                0.095      0.002     48.922      0.000

Between Level

 S          ON
    BLACK             -0.018      0.004     -4.086      0.000

 LNW      WITH
    S                 -0.003      0.001     -3.463      0.001

 Means
    LNW                1.869      0.026     71.797      0.000

 Intercepts
    S                  0.045      0.003     17.043      0.000

 Variances
    LNW                0.050      0.005     10.498      0.000

 Residual Variances
    S                  0.002      0.000      7.682      0.000

Table 5.10, page 184 using ALDACh5Table5.10.txt

We thank Hemant Kher for providing the Mplus code for this example.

Model A: Time.

Title:
  Table 5.10, Model A, Person Period (long) file
Data:
  File is "C:\ALDA\aldach5table5.10.txt";
Variable:
  Names are
     id treat wave day tofday time
     time333 time667 initial final pos;
  Usevariables are
     pos time treat;
     cluster = id;
     within = time;
     between = treat;
Analysis:
  Type = random twolevel ;
  mconvergence = .000001;
  estimator = ml;
model:
  %within%
  s | pos on time;

  %between%
  pos with s;
  pos s on treat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -6340.226

Information Criteria

          Number of Free Parameters              8
          Akaike (AIC)                   12696.452
          Bayesian (BIC)                 12737.448
          Sample-Size Adjusted BIC       12712.036
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 Residual Variances
    POS             1230.014     52.098     23.609      0.000

Between Level

 S          ON
    TREAT              5.536      2.276      2.432      0.015

 POS        ON
    TREAT             -3.109     12.329     -0.252      0.801

 POS      WITH
    S               -121.138     58.866     -2.058      0.040

 Intercepts
    POS              167.462      9.323     17.962      0.000
    S                 -2.417      1.730     -1.398      0.162

 Residual Variances
    POS             2109.669    419.601      5.028      0.000
    S                 63.600     14.224      4.471      0.000

Model B: Time - 3.33.

Title:
  Table 5.10, Model B, Person Period (long) file
Data:
  File is "C:\ALDA\aldach5table5.10.txt";
Variable:
  Names are
     id treat wave day tofday time
     time333 time667 initial final pos;
  Usevariables are
     pos time333 treat;
     cluster = id;
     within = time333;
     between = treat;
Analysis:
  Type = random twolevel ;
  mconvergence = .000001;
  estimator = ml;
model:
  %within%
  s | pos on time333;

  %between%
  pos with s;
  pos s on treat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -6340.226

Information Criteria

          Number of Free Parameters              8
          Akaike (AIC)                   12696.452
          Bayesian (BIC)                 12737.447
          Sample-Size Adjusted BIC       12712.036
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 Residual Variances
    POS             1230.008     52.098     23.610      0.000

Between Level

 S          ON
    TREAT              5.536      2.277      2.432      0.015

 POS        ON
    TREAT             15.346     11.545      1.329      0.184

 POS      WITH
    S                 90.845     52.378      1.734      0.083

 Intercepts
    POS              159.404      8.765     18.187      0.000
    S                 -2.416      1.730     -1.397      0.162

 Residual Variances
    POS             2008.740    367.251      5.470      0.000
    S                 63.604     14.225      4.471      0.000

Model C: Time - 6.67.

Title: 
  Table 5.10, Model C, Person Period (long) file
Data:
  File is "C:\ALDA\aldach5table5.10.txt";
Variable:
  Names are 
     id treat wave day tofday time 
     time333 time667 initial final pos;
  Usevariables are
     pos time667 treat;
     cluster = id;
     within = time667;
     between = treat;
Analysis: 
  Type = random twolevel ;
  mconvergence = .000001;
  estimator = ml;
Model:
  %within%
  s | pos on time667;

  %between%
  pos with s; 
  pos s on treat;
-----------------------------------------------------------------------------
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                       -6340.226

Information Criteria

          Number of Free Parameters              8
          Akaike (AIC)                   12696.452
          Bayesian (BIC)                 12737.448
          Sample-Size Adjusted BIC       12712.036
            (n* = (n + 2) / 24)

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

Within Level

 Residual Variances
    POS             1230.016     52.099     23.609      0.000

Between Level

 S          ON
    TREAT              5.535      2.276      2.432      0.015

 POS        ON
    TREAT             33.797     15.156      2.230      0.026

 POS      WITH
    S                302.802     80.708      3.752      0.000

 Intercepts
    POS              151.349     11.541     13.114      0.000
    S                 -2.417      1.730     -1.397      0.162

 Residual Variances
    POS             3320.892    631.560      5.258      0.000
    S                 63.588     14.219      4.472      0.000

How to cite this page

Report an error on this page or leave a comment

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.