```Mplus VERSION 7.4
MUTHEN & MUTHEN
06/06/2016  10:24 AM

INPUT INSTRUCTIONS

title: Hilbe page 112 example

data:
file = affairs1.dat;

variable:
names = id	male	age	yrsmarr	kids
relig	educ	occup	ratemarr
naffairs	affair	vryhap	hapavg
avgmarr	unhap	vryrel	smerel	slghtrel
notrel;

usevar = naffairs kids vryhap	hapavg
avgmarr vryrel	smerel	slghtrel notrel
yrsmarr3 yrsmarr4 yrsmarr5 yrsmarr6;

! vryhap: very happily married
! hapavg: happily married
! avgmarr: avg marriage
! vryrel: very religious
! smerel: somwhat religious
! slghtrel: slighly religious
! notrel: not religious

count = naffairs; ! count = naffairs(p);

define:
if (yrsmarr==4) then yrsmarr3=1 else yrsmarr3=0;
if (yrsmarr==7) then yrsmarr4=1 else yrsmarr4=0;
if (yrsmarr==10) then yrsmarr5=1 else yrsmarr5=0;
if (yrsmarr==15) then yrsmarr6=1 else yrsmarr6=0;

model:

naffairs on  kids-yrsmarr6;

analysis:
estimator=ml;

plot:
type = plot3;

Hilbe page 112 example

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                         601

Number of dependent variables                                    1
Number of independent variables                                 12
Number of continuous latent variables                            0

Observed dependent variables

Count
NAFFAIRS

Observed independent variables
KIDS        VRYHAP      HAPAVG      AVGMARR     VRYREL      SMEREL
SLGHTREL    NOTREL      YRSMARR3    YRSMARR4    YRSMARR5    YRSMARR6

Estimator                                                       ML
Information matrix                                        OBSERVED
Optimization Specifications for the Quasi-Newton Algorithm for
Continuous Outcomes
Maximum number of iterations                                 100
Convergence criterion                                  0.100D-05
Optimization Specifications for the EM Algorithm
Maximum number of iterations                                 500
Convergence criteria
Loglikelihood change                                 0.100D-02
Relative loglikelihood change                        0.100D-05
Derivative                                           0.100D-02
Optimization Specifications for the M step of the EM Algorithm for
Categorical Latent variables
Number of M step iterations                                    1
M step convergence criterion                           0.100D-02
Basis for M step termination                           ITERATION
Optimization Specifications for the M step of the EM Algorithm for
Censored, Binary or Ordered Categorical (Ordinal), Unordered
Categorical (Nominal) and Count Outcomes
Number of M step iterations                                    1
M step convergence criterion                           0.100D-02
Basis for M step termination                           ITERATION
Maximum value for logit thresholds                            15
Minimum value for logit thresholds                           -15
Minimum expected cell size for chi-square              0.100D-01
Optimization algorithm                                         EMA
Integration Specifications
Type                                                    STANDARD
Number of integration points                                  15
Dimensions of numerical integration                            0
Cholesky                                                       OFF

Input data file(s)
affairs1.dat
Input data format  FREE

COUNT PROPORTION OF ZERO, MINIMUM AND MAXIMUM VALUES

NAFFAIRS    0.750         0        12

THE MODEL ESTIMATION TERMINATED NORMALLY

MODEL FIT INFORMATION

Number of Free Parameters                       13

Loglikelihood

H0 Value                       -1399.913

Information Criteria

Akaike (AIC)                    2825.826
Bayesian (BIC)                  2883.008
(n* = (n + 2) / 24)

MODEL RESULTS

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

NAFFAIRS   ON
KIDS              -0.223      0.106     -2.101      0.036
VRYHAP            -1.384      0.101    -13.707      0.000
HAPAVG            -1.024      0.086    -11.916      0.000
AVGMARR           -0.886      0.105     -8.434      0.000
VRYREL            -1.364      0.159     -8.579      0.000
SMEREL            -1.371      0.121    -11.300      0.000
SLGHTREL          -0.524      0.111     -4.704      0.000
NOTREL            -0.655      0.111     -5.894      0.000
YRSMARR3           0.758      0.161      4.701      0.000
YRSMARR4           1.105      0.170      6.502      0.000
YRSMARR5           1.480      0.165      8.979      0.000
YRSMARR6           1.480      0.156      9.515      0.000

Intercepts
NAFFAIRS           1.102      0.165      6.684      0.000

QUALITY OF NUMERICAL RESULTS

Condition Number for the Information Matrix              0.428E-02
(ratio of smallest to largest eigenvalue)

PLOT INFORMATION

The following plots are available:

Histograms (sample values)
Scatterplots (sample values)
Sample proportions, estimated and conditional estimated probabilities

DIAGRAM INFORMATION

Use View Diagram under the Diagram menu in the Mplus Editor to view the diagram.
If running Mplus from the Mplus Diagrammer, the diagram opens automatically.

Diagram output
c:\users\gryphon\desktop\chapter6\ex6.2_part1.dgm

Beginning Time:  10:24:21
Ending Time:  10:24:21
Elapsed Time:  00:00:00

MUTHEN & MUTHEN
3463 Stoner Ave.
Los Angeles, CA  90066

Tel: (310) 391-9971
Fax: (310) 391-8971
Web: www.StatModel.com
Support: Support@StatModel.com

Copyright (c) 1998-2015 Muthen & Muthen

```