Mplus VERSION 8.8
MUTHEN & MUTHEN
04/19/2022  11:06 PM

INPUT INSTRUCTIONS

  TITLE:	this is an example of a Monte Carlo simulation study for a two-level
          mediation model with random slopes
  MONTECARLO:
  	NAMES ARE y m x;
  	WITHIN = x;
  	NOBSERVATIONS = 1000;
  	NCSIZES = 1;
  	CSIZES = 100 (10);
  	NREP = 100;
  ANALYSIS:	TYPE = TWOLEVEL RANDOM;
  MODEL POPULATION:
  	%WITHIN%
  	x@1;
  	c | y ON x;
  	b | y ON m;
  	a | m ON x;
  	m*1; y*1;
  	%BETWEEN%
  	y WITH m*0.1 b*0.1 a*0.1 c*0.1;
  	m WITH b*0.1 a*0.1 c*0.1;
  	a WITH b*0.1 (cab);
  	a WITH c*0.1;
  	b WITH c*0.1;
  	y*1 m*1 a*1 b*1 c*1;
  	[a*0.4] (ma);
  	[b*0.5] (mb);
  	[c*0.6];
  	MODEL:
  	%WITHIN%
  	c | y ON x;
  	b | y ON m;
  	a | m ON x;
  	m*1; y*1;
  	%BETWEEN%
  	y WITH m*0.1 b*0.1 a*0.1 c*0.1;
  	m WITH b*0.1 a*0.1 c*0.1;
  	a WITH b*0.1 (cab);
  	a WITH c*0.1;
  	b WITH c*0.1;
  	y*1 m*1 a*1 b*1 c*1;
  	[a*0.4] (ma);
  	[b*0.5] (mb);
  	[c*0.6];
  	MODEL CONSTRAINT:
  	NEW(m*0.3);
  	m=ma*mb+cab;



*** WARNING in MODEL command
  In the MODEL command, the predictor variable on the WITHIN level refers to the whole observed
  variable.  To use the latent within-level part, use ESTIMATOR=BAYES in the ANALYSIS command.
  This applies to the following statement(s):
    B | Y ON M
*** WARNING in MODEL POPULATION command
  In the MODEL POPULATION command, the predictor variable on the WITHIN level refers to the whole observed
  variable.  To use the latent within-level part, use ESTIMATOR=BAYES in the ANALYSIS command.
  This applies to the following statement(s):
    B | Y ON M
   2 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS



this is an example of a Monte Carlo simulation study for a two-level
mediation model with random slopes

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                        1000

Number of replications
    Requested                                                  100
    Completed                                                  100
Value of seed                                                    0

Number of dependent variables                                    2
Number of independent variables                                  1
Number of continuous latent variables                            3

Observed dependent variables

  Continuous
   Y           M

Observed independent variables
   X

Continuous latent variables
   C           B           A

Variables with special functions

  Within variables
   X


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

         10           100

     Average cluster size       10.000

     Estimated Intraclass Correlations for the Y Variables

                Intraclass              Intraclass              Intraclass
     Variable  Correlation   Variable  Correlation   Variable  Correlation

     Y            0.324      M            0.329


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
              Y             M             X
              ________      ________      ________
                0.000         0.000        -0.010


           Covariances
              Y             M             X
              ________      ________      ________
 Y              4.973
 M              1.237         2.198
 X              0.823         0.376         1.053


           Correlations
              Y             M             X
              ________      ________      ________
 Y              1.000
 M              0.374         1.000
 X              0.360         0.247         1.000


     ESTIMATED SAMPLE STATISTICS FOR BETWEEN


           Means
              Y             M             X
              ________      ________      ________
               -0.225         0.059         0.000


           Covariances
              Y             M             X
              ________      ________      ________
 Y              2.386
 M              0.512         1.076
 X              0.000         0.000         0.000


           Correlations
              Y             M             X
              ________      ________      ________
 Y              1.000
 M              0.319         1.000
 X              0.000         0.000         0.000




MODEL FIT INFORMATION

Number of Free Parameters                       22

Loglikelihood

    H0 Value

        Mean                             -3406.247
        Std Dev                             33.122
        Number of successful computations      100

             Proportions                   Percentiles
        Expected    Observed         Expected       Observed
           0.990       0.980        -3483.298      -3503.374
           0.980       0.980        -3474.269      -3496.144
           0.950       0.940        -3460.729      -3467.424
           0.900       0.890        -3448.696      -3449.629
           0.800       0.790        -3434.122      -3438.313
           0.700       0.690        -3423.616      -3424.433
           0.500       0.540        -3406.247      -3401.548
           0.300       0.280        -3388.878      -3389.968
           0.200       0.180        -3378.372      -3380.798
           0.100       0.100        -3363.798      -3368.446
           0.050       0.020        -3351.765      -3353.512
           0.020       0.010        -3338.225      -3352.682
           0.010       0.010        -3329.196      -3350.233

Information Criteria

    Akaike (AIC)

        Mean                              6856.494
        Std Dev                             66.244
        Number of successful computations      100

             Proportions                   Percentiles
        Expected    Observed         Expected       Observed
           0.990       0.990         6702.392       6661.895
           0.980       0.990         6720.450       6744.466
           0.950       0.980         6747.530       6750.930
           0.900       0.900         6771.596       6770.412
           0.800       0.820         6800.743       6804.722
           0.700       0.720         6821.756       6823.575
           0.500       0.460         6856.494       6845.770
           0.300       0.310         6891.232       6892.209
           0.200       0.210         6912.244       6913.247
           0.100       0.110         6941.392       6941.687
           0.050       0.060         6965.458       6965.866
           0.020       0.020         6992.538       6987.019
           0.010       0.020         7010.596       7036.289

    Bayesian (BIC)

        Mean                              6964.464
        Std Dev                             66.244
        Number of successful computations      100

             Proportions                   Percentiles
        Expected    Observed         Expected       Observed
           0.990       0.990         6810.362       6769.866
           0.980       0.990         6828.420       6852.437
           0.950       0.980         6855.500       6858.901
           0.900       0.900         6879.567       6878.383
           0.800       0.820         6908.714       6912.692
           0.700       0.720         6929.726       6931.546
           0.500       0.460         6964.464       6953.741
           0.300       0.310         6999.203       7000.180
           0.200       0.210         7020.215       7021.218
           0.100       0.110         7049.362       7049.658
           0.050       0.060         7073.428       7073.837
           0.020       0.020         7100.509       7094.989
           0.010       0.020         7118.567       7144.259

    Sample-Size Adjusted BIC (n* = (n + 2) / 24)

        Mean                              6894.591
        Std Dev                             66.244
        Number of successful computations      100

             Proportions                   Percentiles
        Expected    Observed         Expected       Observed
           0.990       0.990         6740.489       6699.992
           0.980       0.990         6758.547       6782.564
           0.950       0.980         6785.627       6789.028
           0.900       0.900         6809.694       6808.510
           0.800       0.820         6838.841       6842.819
           0.700       0.720         6859.853       6861.672
           0.500       0.460         6894.591       6883.868
           0.300       0.310         6929.329       6930.306
           0.200       0.210         6950.342       6951.345
           0.100       0.110         6979.489       6979.784
           0.050       0.060         7003.555       7003.964
           0.020       0.020         7030.636       7025.116
           0.010       0.020         7048.694       7074.386



MODEL RESULTS

                              ESTIMATES              S. E.     M. S. E.  95%  % Sig
                 Population   Average   Std. Dev.   Average             Cover Coeff

Within Level

 Residual Variances
  Y                   1.000     1.0020     0.0531     0.0530     0.0028 0.960 1.000
  M                   1.000     1.0011     0.0538     0.0496     0.0029 0.910 1.000

Between Level

 Y        WITH
  B                   0.100     0.1212     0.1247     0.1140     0.0158 0.910 0.210
  A                   0.100     0.1087     0.1318     0.1162     0.0173 0.910 0.190
  C                   0.100     0.0868     0.1123     0.1237     0.0127 0.940 0.090

 M        WITH
  B                   0.100     0.1033     0.1029     0.1085     0.0105 0.940 0.120
  A                   0.100     0.0815     0.1081     0.1116     0.0119 0.950 0.070
  C                   0.100     0.1138     0.1148     0.1165     0.0132 0.970 0.160

 A        WITH
  B                   0.100     0.0965     0.1174     0.1101     0.0137 0.920 0.150
  C                   0.100     0.0755     0.1380     0.1312     0.0194 0.910 0.110

 B        WITH
  C                   0.100     0.0892     0.1056     0.1156     0.0112 0.960 0.070

 Y        WITH
  M                   0.100     0.1034     0.1344     0.1284     0.0179 0.940 0.140

 Means
  Y                   0.000     0.0070     0.1151     0.1113     0.0132 0.950 0.050
  M                   0.000    -0.0031     0.1102     0.1056     0.0120 0.950 0.050
  C                   0.600     0.5979     0.1230     0.1125     0.0150 0.930 1.000
  B                   0.500     0.5022     0.1280     0.1061     0.0162 0.890 1.000
  A                   0.400     0.3854     0.0972     0.1072     0.0096 0.970 0.970

 Variances
  Y                   1.000     1.0071     0.1682     0.1689     0.0281 0.910 1.000
  M                   1.000     1.0113     0.1782     0.1571     0.0316 0.930 1.000
  C                   1.000     0.9801     0.1414     0.1717     0.0202 0.980 1.000
  B                   1.000     0.9768     0.1443     0.1545     0.0212 0.950 1.000
  A                   1.000     1.0188     0.1541     0.1587     0.0239 0.950 1.000

New/Additional Parameters
  M                   0.300     0.2904     0.1423     0.1315     0.0201 0.950 0.550


QUALITY OF NUMERICAL RESULTS

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


TECHNICAL 1 OUTPUT


     PARAMETER SPECIFICATION FOR WITHIN


           NU
              Y             M             X
              ________      ________      ________
                    0             0             0


           LAMBDA
              Y             M             X
              ________      ________      ________
 Y                  0             0             0
 M                  0             0             0
 X                  0             0             0


           THETA
              Y             M             X
              ________      ________      ________
 Y                  0
 M                  0             0
 X                  0             0             0


           ALPHA
              Y             M             X
              ________      ________      ________
                    0             0             0


           BETA
              Y             M             X
              ________      ________      ________
 Y                  0             0             0
 M                  0             0             0
 X                  0             0             0


           PSI
              Y             M             X
              ________      ________      ________
 Y                  1
 M                  0             2
 X                  0             0             0


     PARAMETER SPECIFICATION FOR BETWEEN


           NU
              Y             M
              ________      ________
                    0             0


           LAMBDA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 Y                  0             0             0             0             0
 M                  0             0             0             0             0


           THETA
              Y             M
              ________      ________
 Y                  0
 M                  0             0


           ALPHA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
                    3             4             5             6             7


           BETA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C                  0             0             0             0             0
 B                  0             0             0             0             0
 A                  0             0             0             0             0
 Y                  0             0             0             0             0
 M                  0             0             0             0             0


           PSI
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C                  8
 B                  9            10
 A                 11            12            13
 Y                 14            15            16            17
 M                 18            19            20            21            22


     PARAMETER SPECIFICATION FOR THE ADDITIONAL PARAMETERS


           NEW/ADDITIONAL PARAMETERS
              M
              ________
                   23


     STARTING VALUES FOR WITHIN


           NU
              Y             M             X
              ________      ________      ________
                0.000         0.000         0.000


           LAMBDA
              Y             M             X
              ________      ________      ________
 Y              1.000         0.000         0.000
 M              0.000         1.000         0.000
 X              0.000         0.000         1.000


           THETA
              Y             M             X
              ________      ________      ________
 Y              0.000
 M              0.000         0.000
 X              0.000         0.000         0.000


           ALPHA
              Y             M             X
              ________      ________      ________
                0.000         0.000         0.000


           BETA
              Y             M             X
              ________      ________      ________
 Y              0.000         0.000         0.000
 M              0.000         0.000         0.000
 X              0.000         0.000         0.000


           PSI
              Y             M             X
              ________      ________      ________
 Y              1.000
 M              0.000         1.000
 X              0.000         0.000         0.500


     STARTING VALUES FOR BETWEEN


           NU
              Y             M
              ________      ________
                0.000         0.000


           LAMBDA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 Y              0.000         0.000         0.000         1.000         0.000
 M              0.000         0.000         0.000         0.000         1.000


           THETA
              Y             M
              ________      ________
 Y              0.000
 M              0.000         0.000


           ALPHA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
                0.600         0.500         0.400         0.000         0.000


           BETA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C              0.000         0.000         0.000         0.000         0.000
 B              0.000         0.000         0.000         0.000         0.000
 A              0.000         0.000         0.000         0.000         0.000
 Y              0.000         0.000         0.000         0.000         0.000
 M              0.000         0.000         0.000         0.000         0.000


           PSI
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C              1.000
 B              0.100         1.000
 A              0.100         0.100         1.000
 Y              0.100         0.100         0.100         1.000
 M              0.100         0.100         0.100         0.100         1.000


     STARTING VALUES FOR THE ADDITIONAL PARAMETERS


           NEW/ADDITIONAL PARAMETERS
              M
              ________
                0.300


     POPULATION VALUES FOR WITHIN


           NU
              Y             M             X
              ________      ________      ________
                0.000         0.000         0.000


           LAMBDA
              Y             M             X
              ________      ________      ________
 Y              1.000         0.000         0.000
 M              0.000         1.000         0.000
 X              0.000         0.000         1.000


           THETA
              Y             M             X
              ________      ________      ________
 Y              0.000
 M              0.000         0.000
 X              0.000         0.000         0.000


           ALPHA
              Y             M             X
              ________      ________      ________
                0.000         0.000         0.000


           BETA
              Y             M             X
              ________      ________      ________
 Y              0.000         0.000         0.000
 M              0.000         0.000         0.000
 X              0.000         0.000         0.000


           PSI
              Y             M             X
              ________      ________      ________
 Y              1.000
 M              0.000         1.000
 X              0.000         0.000         1.000


     POPULATION VALUES FOR BETWEEN


           NU
              Y             M
              ________      ________
                0.000         0.000


           LAMBDA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 Y              0.000         0.000         0.000         1.000         0.000
 M              0.000         0.000         0.000         0.000         1.000


           THETA
              Y             M
              ________      ________
 Y              0.000
 M              0.000         0.000


           ALPHA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
                0.600         0.500         0.400         0.000         0.000


           BETA
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C              0.000         0.000         0.000         0.000         0.000
 B              0.000         0.000         0.000         0.000         0.000
 A              0.000         0.000         0.000         0.000         0.000
 Y              0.000         0.000         0.000         0.000         0.000
 M              0.000         0.000         0.000         0.000         0.000


           PSI
              C             B             A             Y             M
              ________      ________      ________      ________      ________
 C              1.000
 B              0.100         1.000
 A              0.100         0.100         1.000
 Y              0.100         0.100         0.100         1.000
 M              0.100         0.100         0.100         0.100         1.000


     Beginning Time:  23:06:23
        Ending Time:  23:06:25
       Elapsed Time:  00:00:02



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