```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(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;
f by naffairs; f;

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                            1

Observed dependent variables

Count
NAFFAIRS

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

Continuous latent variables
F

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                            1
Cholesky                                                        ON

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                       14

Loglikelihood

H0 Value                        -735.942

Information Criteria

Akaike (AIC)                    1499.885
Bayesian (BIC)                  1561.465
(n* = (n + 2) / 24)

MODEL RESULTS

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

F        BY
NAFFAIRS           1.000      0.000    999.000    999.000

NAFFAIRS   ON
KIDS               0.012      0.437      0.028      0.977
VRYHAP            -2.574      0.455     -5.658      0.000
HAPAVG            -1.784      0.419     -4.262      0.000
AVGMARR           -1.531      0.489     -3.130      0.002
VRYREL            -2.265      0.669     -3.383      0.001
SMEREL            -2.396      0.553     -4.336      0.000
SLGHTREL          -0.923      0.541     -1.707      0.088
NOTREL            -1.265      0.538     -2.349      0.019
YRSMARR3           1.214      0.549      2.210      0.027
YRSMARR4           1.554      0.607      2.561      0.010
YRSMARR5           2.104      0.620      3.395      0.001
YRSMARR6           1.920      0.549      3.498      0.000

Intercepts
NAFFAIRS          -0.427      0.702     -0.608      0.543

Variances
F                  6.185      0.896      6.900      0.000

QUALITY OF NUMERICAL RESULTS

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

SAMPLE STATISTICS FOR ESTIMATED FACTOR SCORES

SAMPLE STATISTICS

Means
F             F_SE
________      ________
1             -0.001         1.669

Covariances
F             F_SE
________      ________
F              2.994
F_SE          -0.898         0.406

Correlations
F             F_SE
________      ________
F              1.000
F_SE          -0.814         1.000

PLOT INFORMATION

The following plots are available:

Histograms (sample values, estimated factor scores)
Scatterplots (sample values, estimated factor scores)
Sample proportions, estimated and conditional estimated probabilities
Latent variable distribution plots

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_part2.dgm

Beginning Time:  10:24:26
Ending Time:  10:24:27
Elapsed Time:  00:00:01

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

```