#### LEM Textbook ExamplesApplied Latent Class Analysis Chapter 11 Latent Markov Chains by Rolf Langeheine and Frank van de Pol

Table 1 on page 310

  man 5
dim 2 2 2 2 2
lab A B C D E
mod A
B|A
C|B eq1 B|A
D|C eq1 C|B
E|D eq1 D|C

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 2
Converge criterion   = 0.0000000000

X-squared            = 1287.1450 (0.0000)
L-squared            = 1266.0235 (0.0000)
Dissimilarity index  = 0.2188
Degrees of freedom   = 28
Log-likelihood       = -15893.52403
Number of parameters = 3 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 1026.7307
AIC(L-squared)       = 1210.0235
BIC(log-likelihood)  = 31812.6866
AIC(log-likelihood)  = 31793.0481

Eigenvalues information matrix
17374.2297 16434.5436  5059.7212

*** FREQUENCIES ***

A B C D E     observed  estimated  std. res.
1 1 1 1 1     891.000    553.838     14.327
1 1 1 1 2     176.000    231.401     -3.642
1 1 1 2 1     119.000     92.849      2.714
1 1 1 2 2     106.000    235.235     -8.426
1 1 2 1 1     111.000     92.849      1.884
1 1 2 1 2      60.000     38.794      3.405
1 1 2 2 1      52.000     94.388     -4.363
1 1 2 2 2      92.000    239.132     -9.515
1 2 1 1 1     120.000     92.849      2.818
1 2 1 1 2      64.000     38.794      4.047
1 2 1 2 1      51.000     15.566      8.981
1 2 1 2 2      67.000     39.436      4.389
1 2 2 1 1      54.000     94.388     -4.157
1 2 2 1 2      50.000     39.436      1.682
1 2 2 2 1      49.000     95.951     -4.793
1 2 2 2 2     176.000    243.093     -4.303
2 1 1 1 1     237.000    288.855     -3.051
2 1 1 1 2     107.000    120.688     -1.246
2 1 1 2 1      68.000     48.426      2.813
2 1 1 2 2     107.000    122.687     -1.416
2 1 2 1 1      80.000     48.426      4.537
2 1 2 1 2      75.000     20.233     12.176
2 1 2 2 1      51.000     49.228      0.253
2 1 2 2 2     200.000    124.719      6.741
2 2 1 1 1     136.000    293.640     -9.199
2 2 1 1 2      95.000    122.687     -2.500
2 2 1 2 1      64.000     49.228      2.105
2 2 1 2 2     187.000    124.719      5.577
2 2 2 1 1      99.000    298.504    -11.547
2 2 2 1 2     165.000    124.719      3.607
2 2 2 2 1     172.000    303.449     -7.546
2 2 2 2 2    1066.000    768.792     10.719

Table 2 on page 311

 man 5
dim 2 2 2 2 2
lab A B C D E
mod A
B|A
C|B
D|C
E|D

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]
* P(A) *

1              0.4348  (0.0069)
2              0.5652  (0.0069)

* P(B|A) *

1 | 1          0.7181  (0.0095)
2 | 1          0.2819  (0.0095)
1 | 2          0.3180  (0.0086)
2 | 2          0.6820  (0.0086)

* P(C|B) *

1 | 1          0.7152  (0.0090)
2 | 1          0.2848  (0.0090)
1 | 2          0.2998  (0.0090)
2 | 2          0.7002  (0.0090)

* P(D|C) *

1 | 1          0.7037  (0.0090)
2 | 1          0.2963  (0.0090)
1 | 2          0.2719  (0.0088)
2 | 2          0.7281  (0.0088)

* P(E|D) *

1 | 1          0.6857  (0.0092)
2 | 1          0.3143  (0.0092)
1 | 2          0.2383  (0.0083)
2 | 2          0.7617  (0.0083)

Table 3 on page 315

Model 1(M) - A: simple Markov with time homogeneous transitions

  man 5
dim 2 2 2 2 2
lab A B C D E
mod A
B|A
C|B eq1 B|A
D|C eq1 C|B
E|D eq1 D|C

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 2
Converge criterion   = 0.0000000000

X-squared            = 1287.1450 (0.0000)
L-squared            = 1266.0235 (0.0000)
Dissimilarity index  = 0.2188
Degrees of freedom   = 28
Log-likelihood       = -15893.52403
Number of parameters = 3 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 1026.7307
AIC(L-squared)       = 1210.0235
BIC(log-likelihood)  = 31812.6866
AIC(log-likelihood)  = 31793.0481

Model 1 (M) - Part B: simple Markov with time heterogeneous transitions

  man 5
dim 2 2 2 2 2
lab A B C D E
mod A
B|A
C|B
D|C
E|D

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 2
Converge criterion   = 0.0000000000

X-squared            = 1239.4728 (0.0000)
L-squared            = 1209.3446 (0.0000)
Dissimilarity index  = 0.2188
Degrees of freedom   = 22
Log-likelihood       = -15865.18459
Number of parameters = 9 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 1021.3288
AIC(L-squared)       = 1165.3446
BIC(log-likelihood)  = 31807.2847
AIC(log-likelihood)  = 31748.3692

Model 2 (MS) - Part A: Mover-Stayer with time homogeneous transitions

 lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq1 B|XA
D|XC eq1 B|XA
E|XD eq1 B|XA

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0]
sta B|XA [.3 .7 .7 .3 1 0 0 1]

see 12345

*** STATISTICS ***

Number of iterations = 20
Converge criterion   = 0.0000007555
Seed random values   = 12345

X-squared            = 322.8656 (0.0000)
L-squared            = 323.5790 (0.0000)
Dissimilarity index  = 0.0874
Degrees of freedom   = 26
Log-likelihood       = -15422.30179
Number of parameters = 5 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 101.3786
AIC(L-squared)       = 271.5790
BIC(log-likelihood)  = 30887.3344
AIC(log-likelihood)  = 30854.6036

Model 2 (MS) - Part B: Mover-Stayer with time heterogeneous transitions

  lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq2
D|XC eq2
E|XD eq2

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0
3 0 4 0 -1 0 -1 0
5 0 6 0 -1 0 -1 0
7 0 8 0 -1 0 -1 0]
sta B|XA [.3 .7 .7 .3 1 0 0 1]
sta C|XB [.3 .7 .7 .3 1 0 0 1]
sta D|XC [.3 .7 .7 .3 1 0 0 1]
sta E|XD [.3 .7 .7 .3 1 0 0 1]

see 12345

*** STATISTICS ***

Number of iterations = 20
Converge criterion   = 0.0000008469
Seed random values   = 12345

X-squared            = 272.3254 (0.0000)
L-squared            = 270.8196 (0.0000)
Dissimilarity index  = 0.0844
Degrees of freedom   = 20
Log-likelihood       = -15395.92208
Number of parameters = 11 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 99.8962
AIC(L-squared)       = 230.8196
BIC(log-likelihood)  = 30885.8520
AIC(log-likelihood)  = 30813.8442

Model 3 (MM) - Part A: two-chain mixed Markov with time homogeneous transitions

 lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|AX
C|BX eq1 B|AX
D|CX eq1 B|AX
E|DX eq1 B|AX

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

see 12345

*** STATISTICS ***

Number of iterations = 145
Converge criterion   = 0.0000009866
Seed random values   = 12345

X-squared            = 148.9007 (0.0000)
L-squared            = 146.1760 (0.0000)
Dissimilarity index  = 0.0668
Degrees of freedom   = 24
Log-likelihood       = -15333.60030
Number of parameters = 7 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -58.9321
AIC(L-squared)       = 98.1760
BIC(log-likelihood)  = 30727.0238
AIC(log-likelihood)  = 30681.2006

Model 3 (MM) - Part B: two-chain mixed Markov with time heterogeneous transitions

 lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|AX
C|BX
D|CX
E|DX

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 113
Converge criterion   = 0.0000009701
Seed random values   = 5759

X-squared            = 97.4952 (0.0000)
L-squared            = 94.8786 (0.0000)
Dissimilarity index  = 0.0556
Degrees of freedom   = 12
Log-likelihood       = -15307.95159
Number of parameters = 19 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -7.6755
AIC(L-squared)       = 70.8786
BIC(log-likelihood)  = 30778.2804
AIC(log-likelihood)  = 30653.9032

Model 4 (MMS) -Part A: 2 Markov and 1 Stayer chains with time homogeneous transitions

   lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq1 B|XA
D|XC eq1 B|XA
E|XD eq1 B|XA

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 3 0 4 0 -1 0 -1 0]

sta B|AX [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]

*** STATISTICS ***

Number of iterations = 668
Converge criterion   = 0.0000009869
Seed random values   = 4192

X-squared            = 61.8818 (0.0000)
L-squared            = 62.3440 (0.0000)
Dissimilarity index  = 0.0354
Degrees of freedom   = 22
Log-likelihood       = -15291.68430
Number of parameters = 9 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -125.6717
AIC(L-squared)       = 18.3440
BIC(log-likelihood)  = 30660.2841
AIC(log-likelihood)  = 30601.3686

Model 4 (MMS) - Part B: 2 Markov and 1 Stayer chains with time heterogeneous transitions. Notice that the results below do not match with the results in the book. In particular, the BIC and the dissimilarity index don't match.

    lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq2
D|XC eq2
E|XD eq2

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0  2 0  3 0  4 0 -1 0 -1 0
5 0  6 0  7 0  8 0 -1 0 -1 0
9 0 10 0 11 0 12 0 -1 0 -1 0
13 0 14 0 15 0 16 0 -1 0 -1 0]

sta B|XA [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]
sta C|XB [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]
sta D|XC [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]
sta E|XD [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]

see 123457

*** STATISTICS ***

Number of iterations = 652
Converge criterion   = 0.0000009941
Seed random values   = 123457

X-squared            = 6.5738 (0.7650)
L-squared            = 6.5553 (0.7667)
Dissimilarity index  = 0.0092
Degrees of freedom   = 10
Log-likelihood       = -15263.78996
Number of parameters = 21 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -78.9064
AIC(L-squared)       = -13.4447
BIC(log-likelihood)  = 30707.0495
AIC(log-likelihood)  = 30569.5799

Model 5 (IPIPS) - part A: 2 independence and 1 Stayer segments with time homogeneous transitions

  lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|AX eq2
C|BX eq2
D|CX eq2
E|DX eq2

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 1 0 2 0 2 0 -1 0 0 -1
1 0 1 0 2 0 2 0 -1 0 0 -1
1 0 1 0 2 0 2 0 -1 0 0 -1
1 0 1 0 2 0 2 0 -1 0 0 -1]

sta B|AX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta C|BX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta D|CX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta E|DX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]

see 123457

*** STATISTICS ***

Number of iterations = 328
Converge criterion   = 0.0000009864
Seed random values   = 123457

X-squared            = 135.7883 (0.0000)
L-squared            = 130.8476 (0.0000)
Dissimilarity index  = 0.0482
Degrees of freedom   = 24
Log-likelihood       = -15325.93610
Number of parameters = 7 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -74.2605
AIC(L-squared)       = 82.8476
BIC(log-likelihood)  = 30711.6954
AIC(log-likelihood)  = 30665.8722

Model 5 (IPIPS) - part B: 2 independence and 1 Stayer segments with time heterogeneous transitions

    lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|AX eq2
C|BX eq2
D|CX eq2
E|DX eq2

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 1 0 2 0 2 0 -1 0 0 -1
3 0 3 0 4 0 4 0 -1 0 0 -1
5 0 5 0 6 0 6 0 -1 0 0 -1
7 0 7 0 8 0 8 0 -1 0 0 -1]

sta B|AX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta C|BX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta D|CX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]
sta E|DX [.3 .7 .3 .7 .3 .7 .3 .7 1 0 0 1]

see 123457

*** STATISTICS ***

Number of iterations = 314
Converge criterion   = 0.0000009748
Seed random values   = 123457

X-squared            = 80.3806 (0.0000)
L-squared            = 77.2374 (0.0000)
Dissimilarity index  = 0.0331
Degrees of freedom   = 18
Log-likelihood       = -15299.13098
Number of parameters = 13 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -76.5937
AIC(L-squared)       = 41.2374
BIC(log-likelihood)  = 30709.3622
AIC(log-likelihood)  = 30624.2620

Model 6 (MMM) - Part A: three-chain mixed Markov with time homogeneous transitions

 lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|AX
C|BX eq1 B|AX
D|CX eq1 B|AX
E|DX eq1 B|AX

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 1666
Converge criterion   = 0.0000009985
Seed random values   = 4173

X-squared            = 46.5833 (0.0007)
L-squared            = 47.0824 (0.0006)
Dissimilarity index  = 0.0300
Degrees of freedom   = 20
Log-likelihood       = -15284.05348
Number of parameters = 11 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -123.8410
AIC(L-squared)       = 7.0824
BIC(log-likelihood)  = 30662.1148
AIC(log-likelihood)  = 30590.1070

Model 6 (MMM) - Part B: three-chain mixed Markov with time heterogeneous transitions

  lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|AX
C|BX
D|CX
E|DX

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 2877
Converge criterion   = 0.0000009998
Seed random values   = 3113

X-squared            = 1.7243 (0.4223)
L-squared            = 1.7080 (0.4257)
Dissimilarity index  = 0.0042
Degrees of freedom   = 2
Log-likelihood       = -15261.36632
Number of parameters = 29 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -15.3843
AIC(L-squared)       = -2.2920
BIC(log-likelihood)  = 30770.5716
AIC(log-likelihood)  = 30580.7326

Model 7 (LM) - part A: latent Markov with time homogeneous transitions

 lat 5
man 5
dim 2 2 2 2 2 2 2 2 2 2
lab V W X Y Z A B C D E
mod V
W|V
X|W eq1 W|V
Y|X eq1 W|V
Z|Y eq1 W|V
A|V
B|W eq1 A|V
C|X eq1 A|V
D|Y eq1 A|V
E|Z eq1 A|V

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 225
Converge criterion   = 0.0000009939
Seed random values   = 1634

X-squared            = 243.8422 (0.0000)
L-squared            = 235.9275 (0.0000)
Dissimilarity index  = 0.0824
Degrees of freedom   = 26
Log-likelihood       = -15378.47608
Number of parameters = 5 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 13.7271
AIC(L-squared)       = 183.9275
BIC(log-likelihood)  = 30799.6830
AIC(log-likelihood)  = 30766.9522

Model 7 (LM) - part B: latent Markov with time heterogeneous transitions

 lat 5
man 5
dim 2 2 2 2 2 2 2 2 2 2
lab V W X Y Z A B C D E
mod V
W|V
X|W
Y|X
Z|Y
A|V
B|W eq1 A|V
C|X eq1 A|V
D|Y eq1 A|V
E|Z eq1 A|V

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 738
Converge criterion   = 0.0000009934
Seed random values   = 2970

X-squared            = 131.0249 (0.0000)
L-squared            = 130.2462 (0.0000)
Dissimilarity index  = 0.0700
Degrees of freedom   = 20
Log-likelihood       = -15325.63541
Number of parameters = 11 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -40.6772
AIC(L-squared)       = 90.2462
BIC(log-likelihood)  = 30745.2787
AIC(log-likelihood)  = 30673.2708

Model 8 (LC) - Latent class model:

 lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|X  eq1 A|X
C|X  eq1 A|X
D|X  eq1 A|X
E|X  eq1 A|X

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** STATISTICS ***

Number of iterations = 38
Converge criterion   = 0.0000008156
Seed random values   = 4627

X-squared            = 426.6019 (0.0000
L-squared            = 414.0631 (0.0000)
Dissimilarity index  = 0.1160
Degrees of freedom   = 28
Log-likelihood       = -15467.54385
Number of parameters = 3 (+1)
Sample size          = 5147.0
BIC(L-squared)       = 174.7704
AIC(L-squared)       = 358.0631
BIC(log-likelihood)  = 30960.7262
AIC(log-likelihood)  = 30941.0877

Model 9 (LMRr) - latent Markov plus random response with time homogeneous transitions

  lat 5
man 5
dim 3 3 3 3 3 2 2 2 2 2
lab V W X Y Z A B C D E
mod V
W|V
X|W eq1 W|V
Y|X eq1 W|V
Z|Y eq1 W|V

A|V eq2
B|W eq1 A|V
C|X eq1 A|V
D|Y eq1 A|V
E|Z eq1 A|V

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 -1]
sta A|V [.3 .7 .3 .7 .5 .5]

see 123457
ite 10000
mit 10

*** STATISTICS ***

Number of iterations = 7941
Converge criterion   = 0.0000009991
Seed random values   = 123457

X-squared            = 116.9087 (0.0000)
L-squared            = 112.7703 (0.0000)
Dissimilarity index  = 0.0486
Degrees of freedom   = 21
Log-likelihood       = -15316.89745
Number of parameters = 10 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -66.6993
AIC(L-squared)       = 70.7703
BIC(log-likelihood)  = 30719.2566
AIC(log-likelihood)  = 30653.7949


Model 10 (LMM) - latent mixed Markov model:

lat 6
man 5
dim 2 2 2 2 2 2 2 2 2 2 2
lab P V W X Y Z A B C D E
mod P
V|P
W|VP
X|WP eq1 W|VP
Y|XP eq1 W|VP
Z|YP eq1 W|VP

A|VP
B|WP eq1 A|VP
C|XP eq1 A|VP
D|YP eq1 A|VP
E|ZP eq1 A|VP

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

see 123457
ite 10000

*** STATISTICS ***

Number of iterations = 8041
Converge criterion   = 0.0000009997
Seed random values   = 123457

X-squared            = 45.3736 (0.0010)
L-squared            = 46.0087 (0.0008)
Dissimilarity index  = 0.0311
Degrees of freedom   = 20
Log-likelihood       = -15283.51666
Number of parameters = 11 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -124.9147
AIC(L-squared)       = 6.0087
BIC(log-likelihood)  = 30661.0412
AIC(log-likelihood)  = 30589.0333


Model 11(LMS) - latent Mover-Stayer with time homogeneous transitions

  lat 6
man 5
dim 2 2 2 2 2 2 2 2 2 2 2
lab P V W X Y Z A B C D E
mod P
V|P
W|VP eq2
X|WP eq1 W|VP
Y|XP eq1 W|VP
Z|YP eq1 W|VP

A|VP
B|WP eq1 A|VP
C|XP eq1 A|VP
D|YP eq1 A|VP
E|ZP eq1 A|VP

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0]
sta W|VP [.3 .7 .3 .7 1 0 0 1]

see 123457
ite 10000

*** STATISTICS ***

Number of iterations = 9495
Converge criterion   = 0.0000010000
Seed random values   = 123457

X-squared            = 67.6133 (0.0000)
L-squared            = 68.6580 (0.0000)
Dissimilarity index  = 0.0382
Degrees of freedom   = 22
Log-likelihood       = -15294.84133
Number of parameters = 9 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -119.3577
AIC(L-squared)       = 24.6580
BIC(log-likelihood)  = 30666.5982
AIC(log-likelihood)  = 30607.6827

Model 12 (pLMS) - Part A: partially latent Mover-Stayer with time homogeneous transitions

 lat 6
man 5
dim 2 2 2 2 2 2 2 2 2 2 2
lab P V W X Y Z A B C D E
mod P
V|P
W|VP eq2
X|WP eq1 W|VP
Y|XP eq1 W|VP
Z|YP eq1 W|VP

A|VP eq2
B|WP eq1 A|VP
C|XP eq1 A|VP
D|YP eq1 A|VP
E|ZP eq1 A|VP

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0
3 0 4 0 -1 0 -1 0]
sta W|VP [.3 .7 .3 .7 1 0 0 1]
sta A|VP [.3 .7 .3 .7 1 0 0 1]

see 123457
ite 10000

*** STATISTICS ***

Number of iterations = 797
Converge criterion   = 0.0000009762
Seed random values   = 123457

X-squared            = 122.3660 (0.0000)
L-squared            = 119.2194 (0.0000)
Dissimilarity index  = 0.0507
Degrees of freedom   = 24
Log-likelihood       = -15320.12203
Number of parameters = 7 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -85.8886
AIC(L-squared)       = 71.2194
BIC(log-likelihood)  = 30700.0672
AIC(log-likelihood)  = 30654.2441

Model 12 (pLMS) - Part B: partially latent Mover-Stayer with time heterogeneous transitions

 lat 6
man 5
dim 2 2 2 2 2 2 2 2 2 2 2
lab P V W X Y Z A B C D E
mod P
V|P
W|VP eq2
X|WP eq2
Y|XP eq2
Z|YP eq2

A|VP eq2
B|WP eq1 A|VP
C|XP eq1 A|VP
D|YP eq1 A|VP
E|ZP eq1 A|VP

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0
3 0 4 0 -1 0 -1 0
5 0 6 0 -1 0 -1 0
7 0 8 0 -1 0 -1 0
9 0 10 0 -1 0 -1 0]

sta W|VP [.3 .7 .3 .7 1 0 0 1]
sta X|WP [.3 .7 .3 .7 1 0 0 1]
sta Y|XP [.3 .7 .3 .7 1 0 0 1]
sta Z|YP [.3 .7 .3 .7 1 0 0 1]

sta A|VP [.3 .7 .3 .7 1 0 0 1]

see 123457
ite 10000

*** STATISTICS ***

Number of iterations = 1027
Converge criterion   = 0.0000009968
Seed random values   = 123457

X-squared            = 10.9133 (0.8980)
L-squared            = 10.9762 (0.8954)
Dissimilarity index  = 0.0132
Degrees of freedom   = 18
Log-likelihood       = -15266.00040
Number of parameters = 13 (+1)
Sample size          = 5147.0
BIC(L-squared)       = -142.8549
AIC(L-squared)       = -25.0238
BIC(log-likelihood)  = 30643.1010
AIC(log-likelihood)  = 30558.0008

Table 4 on page 319

Model 1: Mover-Stayer model with stationary transition probabilities

 lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq1 B|XA
D|XC eq1 B|XA
E|XD eq1 B|XA

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0]
sta B|XA [.3 .7 .7 .3 1 0 0 1]

see 12345
*** (CONDITIONAL) PROBABILITIES ***

* P(X) *

1              0.7068
2              0.2932

* P(A|X) *

1 | 1          0.4199
2 | 1          0.5801
1 | 2          0.4707
2 | 2          0.5293

* P(B|XA) *

1 | 1 1        0.5864
2 | 1 1        0.4136
1 | 1 2        0.4034
2 | 1 2        0.5966
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(C|XB) *

1 | 1 1        0.5864
2 | 1 1        0.4136
1 | 1 2        0.4034
2 | 1 2        0.5966
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(D|XC) *

1 | 1 1        0.5864
2 | 1 1        0.4136
1 | 1 2        0.4034
2 | 1 2        0.5966
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(E|XD) *

1 | 1 1        0.5864
2 | 1 1        0.4136
1 | 1 2        0.4034
2 | 1 2        0.5966
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

Model 2: two-chain mixed Markov model with stationary transition probabilities

  lat 1
man 5
dim 2 2 2 2 2 2
mod X
A|X
B|AX
C|BX eq1 B|AX
D|CX eq1 B|AX
E|DX eq1 B|AX

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]
*** (CONDITIONAL) PROBABILITIES ***

* P(X) *

1              0.5364  (0.0176)
2              0.4636  (0.0176)

* P(A|X) *

1 | 1          0.1840  (0.0116)
2 | 1          0.8160  (0.0116)
1 | 2          0.7250  (0.0146)
2 | 2          0.2750  (0.0146)

* P(B|XA) *

1 | 1 1        0.3123  (0.0234)
2 | 1 1        0.6877  (0.0234)
1 | 1 2        0.1838  (0.0070)
2 | 1 2        0.8162  (0.0070)
1 | 2 1        0.8274  (0.0075)
2 | 2 1        0.1726  (0.0075)
1 | 2 2        0.7139  (0.0245)
2 | 2 2        0.2861  (0.0245)

* P(C|XB) *

1 | 1 1        0.3123  (0.0234)
2 | 1 1        0.6877  (0.0234)
1 | 1 2        0.1838  (0.0070)
2 | 1 2        0.8162  (0.0070)
1 | 2 1        0.8274  (0.0075)
2 | 2 1        0.1726  (0.0075)
1 | 2 2        0.7139  (0.0245)
2 | 2 2        0.2861  (0.0245)

* P(D|XC) *

1 | 1 1        0.3123  (0.0234)
2 | 1 1        0.6877  (0.0234)
1 | 1 2        0.1838  (0.0070)
2 | 1 2        0.8162  (0.0070)
1 | 2 1        0.8274  (0.0075)
2 | 2 1        0.1726  (0.0075)
1 | 2 2        0.7139  (0.0245)
2 | 2 2        0.2861  (0.0245)

* P(E|XD) *

1 | 1 1        0.3123  (0.0234)
2 | 1 1        0.6877  (0.0234)
1 | 1 2        0.1838  (0.0070)
2 | 1 2        0.8162  (0.0070)
1 | 2 1        0.8274  (0.0075)
2 | 2 1        0.1726  (0.0075)
1 | 2 2        0.7139  (0.0245)
2 | 2 2        0.2861  (0.0245)

Table 5 on page 321 based on the Mover-Mover-Stayer model with stationary transition probabilities


lat 1
man 5
dim 3 2 2 2 2 2
mod X
A|X
B|XA eq2
C|XB eq1 B|XA
D|XC eq1 B|XA
E|XD eq1 B|XA

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 3 0 4 0 -1 0 -1 0]

sta B|AX [.3 .7 .3 .7  .3 .7 .3 .7 1 0 0 1]
*** (CONDITIONAL) PROBABILITIES ***

* P(X) *

1              0.4239
2              0.4215
3              0.1545

* P(A|X) *

1 | 1          0.1965
2 | 1          0.8035
1 | 2          0.6074
2 | 2          0.3926
1 | 3          0.6177
2 | 3          0.3823

* P(B|XA) *

1 | 1 1        0.2809
2 | 1 1        0.7191
1 | 1 2        0.1914
2 | 1 2        0.8086
1 | 2 1        0.7409
2 | 2 1        0.2591
1 | 2 2        0.6528
2 | 2 2        0.3472
1 | 3 1        1.0000 *
2 | 3 1        0.0000 *
1 | 3 2        0.0000 *
2 | 3 2        1.0000 *

* P(C|XB) *

1 | 1 1        0.2809
2 | 1 1        0.7191
1 | 1 2        0.1914
2 | 1 2        0.8086
1 | 2 1        0.7409
2 | 2 1        0.2591
1 | 2 2        0.6528
2 | 2 2        0.3472
1 | 3 1        1.0000 *
2 | 3 1        0.0000 *
1 | 3 2        0.0000 *
2 | 3 2        1.0000 *

* P(D|XC) *

1 | 1 1        0.2809
2 | 1 1        0.7191
1 | 1 2        0.1914
2 | 1 2        0.8086
1 | 2 1        0.7409
2 | 2 1        0.2591
1 | 2 2        0.6528
2 | 2 2        0.3472
1 | 3 1        1.0000 *
2 | 3 1        0.0000 *
1 | 3 2        0.0000 *
2 | 3 2        1.0000 *

* P(E|XD) *

1 | 1 1        0.2809
2 | 1 1        0.7191
1 | 1 2        0.1914
2 | 1 2        0.8086
1 | 2 1        0.7409
2 | 2 1        0.2591
1 | 2 2        0.6528
2 | 2 2        0.3472
1 | 3 1        1.0000 *
2 | 3 1        0.0000 *
1 | 3 2        0.0000 *
2 | 3 2        1.0000 *

Table 6 on page 326

Model 1: simple Markov model

  man 5
dim 2 2 2 2 2
lab A B C D E
mod A
B|A
C|B eq1 B|A
D|C eq1 C|B
E|D eq1 D|C

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

*** (CONDITIONAL) PROBABILITIES ***

* P(A) *

1              0.4348  (0.0069)
2              0.5652  (0.0069)

* P(B|A) *

1 | 1          0.7053  (0.0046)
2 | 1          0.2947  (0.0046)
1 | 2          0.2830  (0.0044)
2 | 2          0.7170  (0.0044)

* P(C|B) *

1 | 1          0.7053  (0.0046)
2 | 1          0.2947  (0.0046)
1 | 2          0.2830  (0.0044)
2 | 2          0.7170  (0.0044)

* P(D|C) *

1 | 1          0.7053  (0.0046)
2 | 1          0.2947  (0.0046)
1 | 2          0.2830  (0.0044)
2 | 2          0.7170  (0.0044)

* P(E|D) *

1 | 1          0.7053  (0.0046)
2 | 1          0.2947  (0.0046)
1 | 2          0.2830  (0.0044)
2 | 2          0.7170  (0.0044)

Model 2: latent Markov model

  lat 5
man 5
dim 2 2 2 2 2 2 2 2 2 2
lab V W X Y Z A B C D E
mod V
W|V
X|W eq1 W|V
Y|X eq1 W|V
Z|Y eq1 W|V
A|V
B|W eq1 A|V
C|X eq1 A|V
D|Y eq1 A|V
E|Z eq1 A|V

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]
* P(V) *

1              0.4453  (0.0116)
2              0.5547  (0.0116)

* P(W|V) *

1 | 1          0.9441  (0.0061)
2 | 1          0.0559  (0.0061)
1 | 2          0.0645  (0.0056)
2 | 2          0.9355  (0.0056)

* P(X|W) *

1 | 1          0.9441  (0.0061)
2 | 1          0.0559  (0.0061)
1 | 2          0.0645  (0.0056)
2 | 2          0.9355  (0.0056)

* P(Y|X) *

1 | 1          0.9441  (0.0061)
2 | 1          0.0559  (0.0061)
1 | 2          0.0645  (0.0056)
2 | 2          0.9355  (0.0056)

* P(Z|Y) *

1 | 1          0.9441  (0.0061)
2 | 1          0.0559  (0.0061)
1 | 2          0.0645  (0.0056)
2 | 2          0.9355  (0.0056)

* P(A|V) *

1 | 1          0.8411  (0.0073)
2 | 1          0.1589  (0.0073)
1 | 2          0.1526  (0.0063)
2 | 2          0.8474  (0.0063)

* P(B|W) *

1 | 1          0.8411  (0.0073)
2 | 1          0.1589  (0.0073)
1 | 2          0.1526  (0.0063)
2 | 2          0.8474  (0.0063)

* P(C|X) *

1 | 1          0.8411  (0.0073)
2 | 1          0.1589  (0.0073)
1 | 2          0.1526  (0.0063)
2 | 2          0.8474  (0.0063)

* P(D|Y) *

1 | 1          0.8411  (0.0073)
2 | 1          0.1589  (0.0073)
1 | 2          0.1526  (0.0063)
2 | 2          0.8474  (0.0063)

* P(E|Z) *

1 | 1          0.8411  (0.0073)
2 | 1          0.1589  (0.0073)
1 | 2          0.1526  (0.0063)
2 | 2          0.8474  (0.0063)

Table 7 on page 328 based on the latent Markov model with random response

  lat 5
man 5
dim 3 3 3 3 3 2 2 2 2 2
lab V W X Y Z A B C D E
mod V
W|V
X|W eq1 W|V
Y|X eq1 W|V
Z|Y eq1 W|V

A|V eq2
B|W eq1 A|V
C|X eq1 A|V
D|Y eq1 A|V
E|Z eq1 A|V

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 -1]
sta A|V [.3 .7 .3 .7 .5 .5]

see 123457
ite 10000
mit 10
*** (CONDITIONAL) PROBABILITIES ***

* P(V) *

1              0.3536
2              0.2412
3              0.4051

* P(W|V) *

1 | 1          0.9583
2 | 1          0.0125
3 | 1          0.0292
1 | 2          0.0207
2 | 2          0.9267
3 | 2          0.0526
1 | 3          0.0441
2 | 3          0.0881
3 | 3          0.8678

* P(X|W) *

1 | 1          0.9583
2 | 1          0.0125
3 | 1          0.0292
1 | 2          0.0207
2 | 2          0.9267
3 | 2          0.0526
1 | 3          0.0441
2 | 3          0.0881
3 | 3          0.8678

* P(Y|X) *

1 | 1          0.9583
2 | 1          0.0125
3 | 1          0.0292
1 | 2          0.0207
2 | 2          0.9267
3 | 2          0.0526
1 | 3          0.0441
2 | 3          0.0881
3 | 3          0.8678

* P(Z|Y) *

1 | 1          0.9583
2 | 1          0.0125
3 | 1          0.0292
1 | 2          0.0207
2 | 2          0.9267
3 | 2          0.0526
1 | 3          0.0441
2 | 3          0.0881
3 | 3          0.8678

* P(A|V) *

1 | 1          0.0926
2 | 1          0.9074
1 | 2          0.9422
2 | 2          0.0578
1 | 3          0.5000
2 | 3          0.5000

* P(B|W) *

1 | 1          0.0926
2 | 1          0.9074
1 | 2          0.9422
2 | 2          0.0578
1 | 3          0.5000
2 | 3          0.5000

* P(C|X) *

1 | 1          0.0926
2 | 1          0.9074
1 | 2          0.9422
2 | 2          0.0578
1 | 3          0.5000
2 | 3          0.5000

* P(D|Y) *

1 | 1          0.0926
2 | 1          0.9074
1 | 2          0.9422
2 | 2          0.0578
1 | 3          0.5000
2 | 3          0.5000

* P(E|Z) *

1 | 1          0.0926
2 | 1          0.9074
1 | 2          0.9422
2 | 2          0.0578
1 | 3          0.5000
2 | 3          0.5000

Table 8 on page 331 based on the partially latent Mover-Stayer model with nonstationary transition probabilities


lat 6
man 5
dim 2 2 2 2 2 2 2 2 2 2 2
lab P V W X Y Z A B C D E
mod P
V|P
W|VP eq2
X|WP eq2
Y|XP eq2
Z|YP eq2

A|VP eq2
B|WP eq1 A|VP
C|XP eq1 A|VP
D|YP eq1 A|VP
E|ZP eq1 A|VP

dat [891 176 119 106 111 60 52  92 120 64 51  67 54  50  49  176
237 107  68 107  80 75 51 200 136 95 64 187 99 165 172 1066]

des [1 0 2 0 -1 0 -1 0
3 0 4 0 -1 0 -1 0
5 0 6 0 -1 0 -1 0
7 0 8 0 -1 0 -1 0
9 0 10 0 -1 0 -1 0]

sta W|VP [.3 .7 .3 .7 1 0 0 1]
sta X|WP [.3 .7 .3 .7 1 0 0 1]
sta Y|XP [.3 .7 .3 .7 1 0 0 1]
sta Z|YP [.3 .7 .3 .7 1 0 0 1]

sta A|VP [.3 .7 .3 .7 1 0 0 1]

see 123457
ite 10000
*** (CONDITIONAL) PROBABILITIES ***

* P(P) *

1              0.8336
2              0.1664

* P(V|P) *

1 | 1          0.6248
2 | 1          0.3752
1 | 2          0.6038
2 | 2          0.3962

* P(W|PV) *

1 | 1 1        0.8111
2 | 1 1        0.1889
1 | 1 2        0.0167
2 | 1 2        0.9833
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(X|PW) *

1 | 1 1        0.8922
2 | 1 1        0.1078
1 | 1 2        0.0618
2 | 1 2        0.9382
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(Y|PX) *

1 | 1 1        0.9478
2 | 1 1        0.0522
1 | 1 2        0.1037
2 | 1 2        0.8963
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(Z|PY) *

1 | 1 1        1.0000
2 | 1 1        0.0000
1 | 1 2        0.1299
2 | 1 2        0.8701
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(A|PV) *

1 | 1 1        0.1743
2 | 1 1        0.8257
1 | 1 2        0.7787
2 | 1 2        0.2213
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(B|PW) *

1 | 1 1        0.1743
2 | 1 1        0.8257
1 | 1 2        0.7787
2 | 1 2        0.2213
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(C|PX) *

1 | 1 1        0.1743
2 | 1 1        0.8257
1 | 1 2        0.7787
2 | 1 2        0.2213
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(D|PY) *

1 | 1 1        0.1743
2 | 1 1        0.8257
1 | 1 2        0.7787
2 | 1 2        0.2213
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

* P(E|PZ) *

1 | 1 1        0.1743
2 | 1 1        0.8257
1 | 1 2        0.7787
2 | 1 2        0.2213
1 | 2 1        1.0000 *
2 | 2 1        0.0000 *
1 | 2 2        0.0000 *
2 | 2 2        1.0000 *

Table 9 on page 334 for multiple group analysis

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.