Mplus VERSION 8.8
MUTHEN & MUTHEN
04/19/2022 10:46 PM
INPUT INSTRUCTIONS
TITLE: this is an example of a two-level CFA with
continuous factor indicators, two covariates,
and random slopes
montecarlo:
names are y1-y4 x1 x2 w;
nobservations = 1000;
ncsizes = 3;
csizes = 40 (5) 50 (10) 20 (15);
seed = 58459;
nreps = 1;
save = ex9.8.dat;
WITHIN = x1 x2;
BETWEEN = w;
ANALYSIS: TYPE = TWOLEVEL RANDOM;
MODEL POPULATION:
%WITHIN%
x1-x2@1;
fw BY y1@1 y2-y4*1;
s1 | fw ON x1;
s2 | fw ON x2;
fw*1;
y1-y4*1;
%BETWEEN%
[w@0]; w*1;
fb BY y1@1 y2-y4*1;
y1-y4@0;
fb*.5;
fb on w*1;
s1 on w*.5;
s2 on w*.3;
[s1*.5 s2*.6]; s1*.5; s2*.6;
MODEL:
%WITHIN%
fw BY y1@1 y2-y4*1;
s1 | fw ON x1;
s2 | fw ON x2;
fw*1;
y1-y4*1;
%BETWEEN%
fb BY y1@1 y2-y4*1;
y1-y4@0;
fb*.5;
fb on w*1;
s1 on w*.5;
s2 on w*.3;
[s1*.5 s2*.6]; s1*.5; s2*.6;
output:
tech9;
INPUT READING TERMINATED NORMALLY
this is an example of a two-level CFA with
continuous factor indicators, two covariates,
and random slopes
SUMMARY OF ANALYSIS
Number of groups 1
Number of observations 1000
Number of replications
Requested 1
Completed 1
Value of seed 58459
Number of dependent variables 4
Number of independent variables 3
Number of continuous latent variables 4
Observed dependent variables
Continuous
Y1 Y2 Y3 Y4
Observed independent variables
X1 X2 W
Continuous latent variables
FW S1 S2 FB
Variables with special functions
Within variables
X1 X2
Between variables
W
Estimator MLR
Information matrix OBSERVED
Maximum number of iterations 100
Convergence criterion 0.100D-05
Maximum number of EM iterations 500
Convergence criteria for the EM algorithm
Loglikelihood change 0.100D-02
Relative loglikelihood change 0.100D-05
Derivative 0.100D-03
Minimum variance 0.100D-03
Maximum number of steepest descent iterations 20
Maximum number of iterations for H1 2000
Convergence criterion for H1 0.100D-03
Optimization algorithm EMA
SUMMARY OF DATA FOR THE FIRST REPLICATION
Cluster information
Size (s) Number of clusters of Size s
5 40
10 50
15 20
Average cluster size 9.091
Estimated Intraclass Correlations for the Y Variables
Intraclass Intraclass Intraclass
Variable Correlation Variable Correlation Variable Correlation
Y1 0.311 Y2 0.308 Y3 0.309
Y4 0.327
SAMPLE STATISTICS FOR THE FIRST REPLICATION
NOTE: The sample statistics for within and between refer to the
maximum-likelihood estimated within and between covariance
matrices, respectively.
ESTIMATED SAMPLE STATISTICS FOR WITHIN
Means
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
0.000 0.000 0.000 0.000 -0.038
Means
X2 W
________ ________
0.033 0.000
Covariances
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 4.167
Y2 2.956 3.725
Y3 3.023 2.921 3.984
Y4 2.945 2.825 2.965 3.794
X1 0.545 0.495 0.511 0.495 1.009
X2 0.527 0.479 0.492 0.500 0.032
W 0.000 0.000 0.000 0.000 0.000
Covariances
X2 W
________ ________
X2 0.959
W 0.000 0.000
Correlations
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 1.000
Y2 0.750 1.000
Y3 0.742 0.758 1.000
Y4 0.741 0.751 0.763 1.000
X1 0.266 0.255 0.255 0.253 1.000
X2 0.264 0.254 0.252 0.262 0.033
W 0.000 0.000 0.000 0.000 0.000
Correlations
X2 W
________ ________
X2 1.000
W 0.000 0.000
ESTIMATED SAMPLE STATISTICS FOR BETWEEN
Means
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
0.000 -0.019 -0.078 0.004 0.000
Means
X2 W
________ ________
0.000 -0.070
Covariances
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 1.880
Y2 1.747 1.656
Y3 1.809 1.714 1.777
Y4 1.835 1.720 1.774 1.845
X1 0.000 0.000 0.000 0.000 0.000
X2 0.000 0.000 0.000 0.000 0.000
W 1.203 1.127 1.149 1.206 0.000
Covariances
X2 W
________ ________
X2 0.000
W 0.000 1.138
Correlations
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 1.000
Y2 0.990 1.000
Y3 0.990 0.999 1.000
Y4 0.986 0.984 0.980 1.000
X1 0.000 0.000 0.000 0.000 0.000
X2 0.000 0.000 0.000 0.000 0.000
W 0.823 0.821 0.808 0.832 0.000
Correlations
X2 W
________ ________
X2 0.000
W 0.000 1.000
MODEL FIT INFORMATION
Number of Free Parameters 23
Loglikelihood
H0 Value
Mean -6752.349
Std Dev 0.000
Number of successful computations 1
Proportions Percentiles
Expected Observed Expected Observed
0.990 0.000 -6752.349 -6752.349
0.980 0.000 -6752.349 -6752.349
0.950 0.000 -6752.349 -6752.349
0.900 0.000 -6752.349 -6752.349
0.800 0.000 -6752.349 -6752.349
0.700 0.000 -6752.349 -6752.349
0.500 0.000 -6752.349 -6752.349
0.300 0.000 -6752.349 -6752.349
0.200 0.000 -6752.349 -6752.349
0.100 0.000 -6752.349 -6752.349
0.050 0.000 -6752.349 -6752.349
0.020 0.000 -6752.349 -6752.349
0.010 0.000 -6752.349 -6752.349
Information Criteria
Akaike (AIC)
Mean 13550.698
Std Dev 0.000
Number of successful computations 1
Proportions Percentiles
Expected Observed Expected Observed
0.990 0.000 13550.698 13550.698
0.980 0.000 13550.698 13550.698
0.950 0.000 13550.698 13550.698
0.900 0.000 13550.698 13550.698
0.800 0.000 13550.698 13550.698
0.700 0.000 13550.698 13550.698
0.500 0.000 13550.698 13550.698
0.300 0.000 13550.698 13550.698
0.200 0.000 13550.698 13550.698
0.100 0.000 13550.698 13550.698
0.050 0.000 13550.698 13550.698
0.020 0.000 13550.698 13550.698
0.010 0.000 13550.698 13550.698
Bayesian (BIC)
Mean 13663.577
Std Dev 0.000
Number of successful computations 1
Proportions Percentiles
Expected Observed Expected Observed
0.990 0.000 13663.577 13663.577
0.980 0.000 13663.577 13663.577
0.950 0.000 13663.577 13663.577
0.900 0.000 13663.577 13663.577
0.800 0.000 13663.577 13663.577
0.700 0.000 13663.577 13663.577
0.500 0.000 13663.577 13663.577
0.300 0.000 13663.577 13663.577
0.200 0.000 13663.577 13663.577
0.100 0.000 13663.577 13663.577
0.050 0.000 13663.577 13663.577
0.020 0.000 13663.577 13663.577
0.010 0.000 13663.577 13663.577
Sample-Size Adjusted BIC (n* = (n + 2) / 24)
Mean 13590.528
Std Dev 0.000
Number of successful computations 1
Proportions Percentiles
Expected Observed Expected Observed
0.990 0.000 13590.528 13590.528
0.980 0.000 13590.528 13590.528
0.950 0.000 13590.528 13590.528
0.900 0.000 13590.528 13590.528
0.800 0.000 13590.528 13590.528
0.700 0.000 13590.528 13590.528
0.500 0.000 13590.528 13590.528
0.300 0.000 13590.528 13590.528
0.200 0.000 13590.528 13590.528
0.100 0.000 13590.528 13590.528
0.050 0.000 13590.528 13590.528
0.020 0.000 13590.528 13590.528
0.010 0.000 13590.528 13590.528
MODEL RESULTS
ESTIMATES S. E. M. S. E. 95% % Sig
Population Average Std. Dev. Average Cover Coeff
Within Level
FW BY
Y1 1.000 1.0000 0.0000 0.0000 0.0000 1.000 0.000
Y2 1.000 0.9665 0.0000 0.0279 0.0011 1.000 1.000
Y3 1.000 0.9961 0.0000 0.0310 0.0000 1.000 1.000
Y4 1.000 0.9682 0.0000 0.0256 0.0010 1.000 1.000
Residual Variances
Y1 1.000 1.1337 0.0000 0.0644 0.0179 0.000 1.000
Y2 1.000 0.9094 0.0000 0.0495 0.0082 1.000 1.000
Y3 1.000 0.9803 0.0000 0.0492 0.0004 1.000 1.000
Y4 1.000 0.9695 0.0000 0.0557 0.0009 1.000 1.000
FW 1.000 1.1997 0.0000 0.0814 0.0399 0.000 1.000
Between Level
FB BY
Y1 1.000 1.0000 0.0000 0.0000 0.0000 1.000 0.000
Y2 1.000 0.9337 0.0000 0.0361 0.0044 1.000 1.000
Y3 1.000 0.9705 0.0000 0.0333 0.0009 1.000 1.000
Y4 1.000 0.9873 0.0000 0.0424 0.0002 1.000 1.000
FB ON
W 1.000 1.0425 0.0000 0.0805 0.0018 1.000 1.000
S1 ON
W 0.500 0.5099 0.0000 0.0855 0.0001 1.000 1.000
S2 ON
W 0.300 0.1008 0.0000 0.0785 0.0397 0.000 0.000
Intercepts
Y1 0.000 0.0579 0.0000 0.0904 0.0034 1.000 0.000
Y2 0.000 0.0333 0.0000 0.0836 0.0011 1.000 0.000
Y3 0.000 -0.0216 0.0000 0.0907 0.0005 1.000 0.000
Y4 0.000 0.0565 0.0000 0.0865 0.0032 1.000 0.000
S1 0.500 0.5596 0.0000 0.0871 0.0035 1.000 1.000
S2 0.600 0.4706 0.0000 0.0910 0.0167 1.000 1.000
Residual Variances
Y1 0.000 0.0000 0.0000 0.0000 0.0000 1.000 0.000
Y2 0.000 0.0000 0.0000 0.0000 0.0000 1.000 0.000
Y3 0.000 0.0000 0.0000 0.0000 0.0000 1.000 0.000
Y4 0.000 0.0000 0.0000 0.0000 0.0000 1.000 0.000
S1 0.500 0.5236 0.0000 0.0968 0.0006 1.000 1.000
S2 0.600 0.5825 0.0000 0.1290 0.0003 1.000 1.000
FB 0.500 0.5682 0.0000 0.1274 0.0047 1.000 1.000
QUALITY OF NUMERICAL RESULTS
Average Condition Number for the Information Matrix 0.694E-02
(ratio of smallest to largest eigenvalue)
TECHNICAL 1 OUTPUT
PARAMETER SPECIFICATION FOR WITHIN
NU
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
0 0 0 0 0
NU
X2
________
0
LAMBDA
FW X1 X2
________ ________ ________
Y1 0 0 0
Y2 1 0 0
Y3 2 0 0
Y4 3 0 0
X1 0 0 0
X2 0 0 0
THETA
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 4
Y2 0 5
Y3 0 0 6
Y4 0 0 0 7
X1 0 0 0 0 0
X2 0 0 0 0 0
THETA
X2
________
X2 0
ALPHA
FW X1 X2
________ ________ ________
0 0 0
BETA
FW X1 X2
________ ________ ________
FW 0 0 0
X1 0 0 0
X2 0 0 0
PSI
FW X1 X2
________ ________ ________
FW 8
X1 0 0
X2 0 0 0
PARAMETER SPECIFICATION FOR BETWEEN
NU
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
9 10 11 12 0
LAMBDA
S1 S2 FB W
________ ________ ________ ________
Y1 0 0 0 0
Y2 0 0 13 0
Y3 0 0 14 0
Y4 0 0 15 0
W 0 0 0 0
THETA
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
Y1 0
Y2 0 0
Y3 0 0 0
Y4 0 0 0 0
W 0 0 0 0 0
ALPHA
S1 S2 FB W
________ ________ ________ ________
16 17 0 0
BETA
S1 S2 FB W
________ ________ ________ ________
S1 0 0 0 18
S2 0 0 0 19
FB 0 0 0 20
W 0 0 0 0
PSI
S1 S2 FB W
________ ________ ________ ________
S1 21
S2 0 22
FB 0 0 23
W 0 0 0 0
STARTING VALUES FOR WITHIN
NU
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
0.000 0.000 0.000 0.000 0.000
NU
X2
________
0.000
LAMBDA
FW X1 X2
________ ________ ________
Y1 1.000 0.000 0.000
Y2 1.000 0.000 0.000
Y3 1.000 0.000 0.000
Y4 1.000 0.000 0.000
X1 0.000 1.000 0.000
X2 0.000 0.000 1.000
THETA
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 1.000
Y2 0.000 1.000
Y3 0.000 0.000 1.000
Y4 0.000 0.000 0.000 1.000
X1 0.000 0.000 0.000 0.000 0.000
X2 0.000 0.000 0.000 0.000 0.000
THETA
X2
________
X2 0.000
ALPHA
FW X1 X2
________ ________ ________
0.000 0.000 0.000
BETA
FW X1 X2
________ ________ ________
FW 0.000 0.000 0.000
X1 0.000 0.000 0.000
X2 0.000 0.000 0.000
PSI
FW X1 X2
________ ________ ________
FW 1.000
X1 0.000 0.500
X2 0.000 0.000 0.500
STARTING VALUES FOR BETWEEN
NU
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
0.000 0.000 0.000 0.000 0.000
LAMBDA
S1 S2 FB W
________ ________ ________ ________
Y1 0.000 0.000 1.000 0.000
Y2 0.000 0.000 1.000 0.000
Y3 0.000 0.000 1.000 0.000
Y4 0.000 0.000 1.000 0.000
W 0.000 0.000 0.000 1.000
THETA
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
Y1 0.000
Y2 0.000 0.000
Y3 0.000 0.000 0.000
Y4 0.000 0.000 0.000 0.000
W 0.000 0.000 0.000 0.000 0.000
ALPHA
S1 S2 FB W
________ ________ ________ ________
0.500 0.600 0.000 0.000
BETA
S1 S2 FB W
________ ________ ________ ________
S1 0.000 0.000 0.000 0.500
S2 0.000 0.000 0.000 0.300
FB 0.000 0.000 0.000 1.000
W 0.000 0.000 0.000 0.000
PSI
S1 S2 FB W
________ ________ ________ ________
S1 0.500
S2 0.000 0.600
FB 0.000 0.000 0.500
W 0.000 0.000 0.000 0.500
POPULATION VALUES FOR WITHIN
NU
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
0.000 0.000 0.000 0.000 0.000
NU
X2
________
0.000
LAMBDA
FW X1 X2
________ ________ ________
Y1 1.000 0.000 0.000
Y2 1.000 0.000 0.000
Y3 1.000 0.000 0.000
Y4 1.000 0.000 0.000
X1 0.000 1.000 0.000
X2 0.000 0.000 1.000
THETA
Y1 Y2 Y3 Y4 X1
________ ________ ________ ________ ________
Y1 1.000
Y2 0.000 1.000
Y3 0.000 0.000 1.000
Y4 0.000 0.000 0.000 1.000
X1 0.000 0.000 0.000 0.000 0.000
X2 0.000 0.000 0.000 0.000 0.000
THETA
X2
________
X2 0.000
ALPHA
FW X1 X2
________ ________ ________
0.000 0.000 0.000
BETA
FW X1 X2
________ ________ ________
FW 0.000 0.000 0.000
X1 0.000 0.000 0.000
X2 0.000 0.000 0.000
PSI
FW X1 X2
________ ________ ________
FW 1.000
X1 0.000 1.000
X2 0.000 0.000 1.000
POPULATION VALUES FOR BETWEEN
NU
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
0.000 0.000 0.000 0.000 0.000
LAMBDA
S1 S2 FB W
________ ________ ________ ________
Y1 0.000 0.000 1.000 0.000
Y2 0.000 0.000 1.000 0.000
Y3 0.000 0.000 1.000 0.000
Y4 0.000 0.000 1.000 0.000
W 0.000 0.000 0.000 1.000
THETA
Y1 Y2 Y3 Y4 W
________ ________ ________ ________ ________
Y1 0.000
Y2 0.000 0.000
Y3 0.000 0.000 0.000
Y4 0.000 0.000 0.000 0.000
W 0.000 0.000 0.000 0.000 0.000
ALPHA
S1 S2 FB W
________ ________ ________ ________
0.500 0.600 0.000 0.000
BETA
S1 S2 FB W
________ ________ ________ ________
S1 0.000 0.000 0.000 0.500
S2 0.000 0.000 0.000 0.300
FB 0.000 0.000 0.000 1.000
W 0.000 0.000 0.000 0.000
PSI
S1 S2 FB W
________ ________ ________ ________
S1 0.500
S2 0.000 0.600
FB 0.000 0.000 0.500
W 0.000 0.000 0.000 1.000
TECHNICAL 9 OUTPUT
Error messages for each replication (if any)
SAVEDATA INFORMATION
Order of variables
Y1
Y2
Y3
Y4
X1
X2
W
CLUSTER
Save file
ex9.8.dat
Save file format Free
Save file record length 10000
Beginning Time: 22:46:45
Ending Time: 22:46:46
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-2022 Muthen & Muthen
Back to examples