Rudi[M]entary Model Commands in Mplus – part 1: WITH

One of the beautiful things about Mplus is that there are only three rudimentary model commands. One of these is “WITH” which asks Mplus to correlate/covariate variables that fall on either side of it.

Here is an generic syntax applying the WITH model command:

TITLE:
Simple correlation analysis;

DATA:
File is FILENAME.dat;

VARIABLE:
Names are VARx VARy;

Missing are all(-999);

Usevariables = VARx VARy;

MODEL:
VARx with VARy;

OUTPUT:
Standardized Sampstat;

Visually the above is asking, what is the relationship between VARx and VARy (i.e., no causation is inferred):

correlation

Imagine you have a bunch of variables you want to correlate, how would you write the syntax so that you can create a correlation matrix? Below is an applied example using real data to answer this question.

Screen Shot 2017-04-29 at 12.45.15 AM

Here we are looking at the correlations between political knowledge (i.e., an employee’s collection of strategic and potentially sensitive information about his or her supervisor), political will (i.e., an individual’s motivation to engage in political behaviour), political skill (i.e., an individual’s interpersonal effectiveness), and change-oriented organizational citizenship behaviour (i.e., an individual’s extra-role behaviour enacted to bring around change in the workplace).

The above syntax produces the output below. There are actually two places where standardized correlations are provided because I also asked for the sample statistics (sampstat) under the output command: one under SAMPLE STATISTICS and one under STANDARDIZED MODEL RESULTS (see highlighted areas):


Mplus VERSION 7.4 (Mac)
MUTHEN & MUTHEN
04/29/2017  12:32 AM

INPUT INSTRUCTIONS

TITLE:
Simple Correlation Analysis;

DATA:
File is PK4correlations.dat;

VARIABLE:
Names are PK PW PS PT CHOCB LMX;
Missing are all(-999);
Usevariables = PK PW PS CHOCB;

ANALYSIS:
Estimator = ML;

MODEL:
PK PW PS CHOCB with PK PW PS CHOCB;

OUTPUT:
Standardized sampstat;

*** WARNING
Data set contains cases with missing on all variables.
These cases were not included in the analysis.
Number of cases with missing on all variables:  1
1 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS

Simple Correlation Analysis;

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                         494

Number of dependent variables                                    4
Number of independent variables                                  0
Number of continuous latent variables                            0

Observed dependent variables

Continuous
PK          PW          PS          CHOCB

Estimator                                                       ML
Information matrix                                        OBSERVED
Maximum number of iterations                                  1000
Convergence criterion                                    0.500D-04
Maximum number of steepest descent iterations                   20
Maximum number of iterations for H1                           2000
Convergence criterion for H1                             0.100D-03

Input data file(s)
PK4correlations.dat

Input data format  FREE

SUMMARY OF DATA

Number of missing data patterns             3

COVARIANCE COVERAGE OF DATA

Minimum covariance coverage value   0.100

PROPORTION OF DATA PRESENT

Covariance Coverage
PK            PW            PS            CHOCB
________      ________      ________      ________
PK             0.998
PW             0.996         0.996
PS             0.996         0.996         0.996
CHOCB          0.998         0.996         0.996         1.000

SAMPLE STATISTICS

ESTIMATED SAMPLE STATISTICS

Means
PK            PW            PS            CHOCB
________      ________      ________      ________
1         3.459         4.130         5.100         3.642

Covariances
PK            PW            PS            CHOCB
________      ________      ________      ________
PK             0.547
PW             0.215         1.640
PS             0.360         0.347         1.042
CHOCB          0.238         0.232         0.384         0.586

Correlations
PK            PW            PS            CHOCB
________      ________      ________      ________
PK             1.000
PW             0.227         1.000
PS             0.476         0.265         1.000
CHOCB          0.421         0.237         0.492         1.000

MAXIMUM LOG-LIKELIHOOD VALUE FOR THE UNRESTRICTED (H1) MODEL IS -2477.074

UNIVARIATE SAMPLE STATISTICS

UNIVARIATE HIGHER-ORDER MOMENT DESCRIPTIVE STATISTICS

Variable/         Mean/     Skewness/   Minimum/ % with                Percentiles
Sample Size      Variance    Kurtosis    Maximum  Min/Max      20%/60%    40%/80%    Median

PK                    3.458      -0.433       1.040    0.20%       2.870      3.350      3.520
493.000       0.547       0.200       5.000    1.01%       3.700      4.090
PW                    4.130      -0.403       1.000    2.24%       3.130      3.880      4.250
492.000       1.640      -0.338       7.000    0.20%       4.500      5.250
PS                    5.100      -0.581       1.220    0.20%       4.280      4.940      5.220
492.000       1.043       0.542       7.000    2.03%       5.440      5.940
CHOCB                 3.642      -0.583       1.000    0.40%       3.000      3.500      3.750
494.000       0.586       0.441       5.000    5.47%       4.000      4.250

THE MODEL ESTIMATION TERMINATED NORMALLY

MODEL FIT INFORMATION

Number of Free Parameters                       14

Loglikelihood

H0 Value                       -2477.074
H1 Value                       -2477.074

Information Criteria

Akaike (AIC)                    4982.147
Bayesian (BIC)                  5040.983
Sample-Size Adjusted BIC        4996.546
(n* = (n + 2) / 24)

Chi-Square Test of Model Fit

Value                              0.000
Degrees of Freedom                     0
P-Value                           0.0000

RMSEA (Root Mean Square Error Of Approximation)

Estimate                           0.000
90 Percent C.I.                    0.000  0.000
Probability RMSEA <= .05           0.000

CFI/TLI

CFI                                1.000
TLI                                1.000

Chi-Square Test of Model Fit for the Baseline Model

Value                            341.302
Degrees of Freedom                     6
P-Value                           0.0000

SRMR (Standardized Root Mean Square Residual)

Value                              0.000

MODEL RESULTS

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

PK       WITH
PW                 0.215      0.044      4.910      0.000
PS                 0.360      0.038      9.548      0.000
CHOCB              0.238      0.028      8.612      0.000

PW       WITH
PS                 0.347      0.061      5.687      0.000
CHOCB              0.232      0.045      5.111      0.000

PS       WITH
CHOCB              0.384      0.039      9.796      0.000

Means
PK                 3.459      0.033    103.886      0.000
PW                 4.130      0.058     71.548      0.000
PS                 5.100      0.046    110.878      0.000
CHOCB              3.642      0.034    105.760      0.000

Variances
PK                 0.547      0.035     15.700      0.000
PW                 1.640      0.105     15.686      0.000
PS                 1.042      0.066     15.692      0.000
CHOCB              0.586      0.037     15.716      0.000

STANDARDIZED MODEL RESULTS

STDYX Standardization

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

PK       WITH
PW                 0.227      0.043      5.307      0.000
PS                 0.476      0.035     13.677      0.000
CHOCB              0.421      0.037     11.350      0.000

PW       WITH
PS                 0.265      0.042      6.328      0.000
CHOCB              0.237      0.043      5.563      0.000

PS       WITH
CHOCB              0.492      0.034     14.385      0.000

Means
PK                 4.678      0.156     30.066      0.000
PW                 3.225      0.112     28.738      0.000
PS                 4.996      0.165     30.206      0.000
CHOCB              4.758      0.158     30.130      0.000

Variances
PK                 1.000      0.000    999.000    999.000
PW                 1.000      0.000    999.000    999.000
PS                 1.000      0.000    999.000    999.000
CHOCB              1.000      0.000    999.000    999.000

STDY Standardization

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

PK       WITH
PW                 0.227      0.043      5.307      0.000
PS                 0.476      0.035     13.677      0.000
CHOCB              0.421      0.037     11.350      0.000

PW       WITH
PS                 0.265      0.042      6.328      0.000
CHOCB              0.237      0.043      5.563      0.000

PS       WITH
CHOCB              0.492      0.034     14.385      0.000

Means
PK                 4.678      0.156     30.066      0.000
PW                 3.225      0.112     28.738      0.000
PS                 4.996      0.165     30.206      0.000
CHOCB              4.758      0.158     30.130      0.000

Variances
PK                 1.000      0.000    999.000    999.000
PW                 1.000      0.000    999.000    999.000
PS                 1.000      0.000    999.000    999.000
CHOCB              1.000      0.000    999.000    999.000

STD Standardization

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

PK       WITH
PW                 0.215      0.044      4.910      0.000
PS                 0.360      0.038      9.548      0.000
CHOCB              0.238      0.028      8.612      0.000

PW       WITH
PS                 0.347      0.061      5.687      0.000
CHOCB              0.232      0.045      5.111      0.000

PS       WITH
CHOCB              0.384      0.039      9.796      0.000

Means
PK                 3.459      0.033    103.886      0.000
PW                 4.130      0.058     71.548      0.000
PS                 5.100      0.046    110.878      0.000
CHOCB              3.642      0.034    105.760      0.000

Variances
PK                 0.547      0.035     15.700      0.000
PW                 1.640      0.105     15.686      0.000
PS                 1.042      0.066     15.692      0.000
CHOCB              0.586      0.037     15.716      0.000

R-SQUARE

QUALITY OF NUMERICAL RESULTS

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

Beginning Time:  00:32:46
Ending Time:  00:32:46
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

We can conclude that all of the variables are correlated significantly (ps < .001) but that there are stronger correlations between political knowledge, political skill, and change-oriented organizational citizenship behaviour. So individuals who have a deep understanding of their supervisor are also more socially astute and also try to bring around more change in the workplace. However, as any lesson on correlation goes, causation cannot be inferred! All we can tell from this analysis is that these variables go hand-in-hand in the same direction (i.e., as one goes up, so does the other and vice versa).

Finally, you can take the correlations in the output and create a beautiful table:

Screen Shot 2017-04-29 at 1.53.01 PM

Okay, maybe not beautiful, but informative at least! And that’s about sums up basic correlation analysis.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s