Get [M]oving with Mplus – part 4: Individual versus Summary Data

One of the many cool things about Mplus is that you have the option to run individual and summary data. And what does that mean exactly? Well, in addition to the typical individual data where each tab separated colum is a variable (like you’d see in a typical dataset), like this:

Screen Shot 2017-04-27 at 11.46.46 PM

…you can take a correlation table (along with the means, standard deviations, and sample size) like this:

Screen Shot 2017-04-27 at 11.42.57 PM

…and run analyses like you normally would. Now, that’s pretty cool.

What you see in the summary data file is

first line: means

second line: standard deviations

third line onwards: lower diagonal of your correlation/covariance matrix

and all else you would need to do is specify a few more things under the DATA command line to run analysis like normal:

Type = means stdeviations correlations;

Nobservations = # of observations in dataset;

and this would look like the following:

Screen Shot 2017-04-28 at 12.24.19 AM

On another note, if you have a full correlation or covariance matrix instead of only the bottom diagonal, you would replace correlation in the Type subcommand with FULLCORR or FULLCOV

Otherwise have at it the same way you would typically run analyses with individual level data — but now you also have a tool to check the integrity of published analyses!

Hofmann & Morgeson (1999) example

When I heard about the ability to use summary data, I thought it was incredibly cool but never actually tried it out for myself (beyond using a dataset that was already prepared with summary data). So I went and tried it out for myself and here are the steps I took:

Step 1:

Locate an article that has a correlation table, means, standard deviations and sample size available. In my case, I just picked a random article on support and employee safety from a top journal in my field (Hofmann & Morgeson, 1999).

Screen Shot 2017-04-28 at 2.34.42 PM

Step 2:

Record data into a .dat file (at least 2 easy options)

  • [Easiest] On Mac, open TextEdit (for Windows, it is probably similar with Notepad) and make sure it is in Plain text (to check, go to Format and look for “Make Plain Text”, if it is already in this format, you will see Make Rich Text)
    • Enter the means on the top row: start tight to top left corner, enter a number, press tab, enter next number, etc.
    • Enter standard deviations on second row: press enter once all means are in, and repeat the same thing with standard deviations making sure they are separated by pressing tab
    • Enter correlation/covariance table the same way you entered the means and standard deviations
    • Save file with the extension: .dat

Screen Shot 2017-04-28 at 2.47.01 PM

  • [Second easiest] Do the same thing in SPSS
    • Save as Fixed ASCII (*.dat)

Screen Shot 2017-04-28 at 2.51.41 PM

Step 3:

Write your syntax and save it in the same folder as the data file. Below is an example of the syntax as a screenshot and a copy-and-paste ready code

Screen Shot 2017-04-28 at 2.57.58 PM

TITLE:
Sample summary data analysis on Hofmann & Morgeson 1999;
DATA:
File is H&M1999.dat;
Type is MEANS STDEVIATIONS CORRELATION;
Nobservations = 49;
!they have uneven observations by variable, but we'll stick with 49

VARIABLE:
names are POS LMX SCMU SCMI ACC AGE ORGT JOBT;
!POS = perceived org support
!LMX = leader-member exchange
!SCMU = safety communication
!SCMI = safety commitment
!ACC = accidents
!ORGT = org tenure
!JOBT = job tenure
usevariables = POS LMX SCMU SCMI ACC;

!H1&2: POS & LMX +r w/ SCMU
!H3&4: POS & LMX +r w/ SCMI
!H5: SCMU +r w/ SCMI
!H6&7: SCMU & SCMI -r w/ ACC

ANALYSIS:
Estimator = ML;
MODEL:
SCMU on POS LMX; !H1&2
SCMI on POS LMX; !H3&4
SCMU with SCMI; !H5
ACC on SCMU SCMI; !H6&7

OUTPUT:
Standardized sampstat TECH1;

Step 4:

Press run and see if it works! Below is the output that was produced when I ran the above syntax. The results of interest can be found under STANDARDIZED MODEL RESULTS. We can see that we replicate the basic findings for hypotheses 1-5 (a non-finding in the case of hypothesis 3), but we actually do not find that safety communication and safety commitment have a significant negative association with accidents (likely due to power issues in how I ran the analyses – they only looked at the correlation coefficients, while I ran a multiple regression which takes into account overlapping variance):

Mplus VERSION 7.4 (Mac)
MUTHEN & MUTHEN
04/28/2017   2:43 PM

INPUT INSTRUCTIONS

  TITLE:
  	Sample summary data analysis on Hofmann & Morgeson 1999;
  DATA:
  	File is H&M1999.dat;
  	Type is MEANS STDEVIATIONS CORRELATION;
  	Nobservations = 49;
  	!they have uneven observations by variable, but we'll stick with 49

  VARIABLE:
  	names are POS LMX SCMU SCMI ACC AGE ORGT JOBT;
  	!POS = perceived org support
  	!LMX = leader-member exchange
  	!SCMU = safety communication
  	!SCMI = safety commitment
  	!ACC = accidents
  	!ORGT = org tenure
  	!JOBT = job tenure
  	usevariables = POS LMX SCMU SCMI ACC;

  	!H1&2: POS & LMX +r w/ SCMU
  	!H3&4: POS & LMX +r w/ SCMI
  	!H5: SCMU +r w/ SCMI
  	!H6&7: SCMU & SCMI -r w/ ACC

  ANALYSIS:
  	Estimator = ML;
  MODEL:
  	SCMU on POS LMX; !H1&2
  	SCMI on POS LMX; !H3&4
  	SCMU with SCMI; !H5
  	ACC on SCMU SCMI; !H6&7

  OUTPUT:
  	Standardized sampstat TECH1;

INPUT READING TERMINATED NORMALLY

Sample summary data analysis on Hofmann & Morgeson 1999;

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                          49

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

Observed dependent variables

  Continuous
   SCMU        SCMI        ACC

Observed independent variables
   POS         LMX

Estimator                                                       ML
Information matrix                                        EXPECTED
Maximum number of iterations                                  1000
Convergence criterion                                    0.500D-04
Maximum number of steepest descent iterations                   20

Input data file(s)
  H&M1999.dat

Input data format  FREE

SAMPLE STATISTICS

     SAMPLE STATISTICS

           Means/Intercepts/Thresholds
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           Covariances/Correlations/Residual Correlations
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.449
 SCMI           0.183         0.608
 ACC           -0.274        -0.296         2.132
 POS            0.311         0.074        -0.113         0.740
 LMX            0.246         0.176        -0.364         0.322         0.608

THE MODEL ESTIMATION TERMINATED NORMALLY

MODEL FIT INFORMATION

Number of Free Parameters                       13

Loglikelihood

          H0 Value                        -176.104
          H1 Value                        -174.654

Information Criteria

          Akaike (AIC)                     378.207
          Bayesian (BIC)                   402.801
          Sample-Size Adjusted BIC         362.006
            (n* = (n + 2) / 24)

Chi-Square Test of Model Fit

          Value                              2.900
          Degrees of Freedom                     2
          P-Value                           0.2346

RMSEA (Root Mean Square Error Of Approximation)

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

CFI/TLI

          CFI                                0.969
          TLI                                0.862

Chi-Square Test of Model Fit for the Baseline Model

          Value                             38.320
          Degrees of Freedom                     9
          P-Value                           0.0000

SRMR (Standardized Root Mean Square Residual)

          Value                              0.038

MODEL RESULTS

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    POS               -0.034      0.141     -0.244      0.808
    LMX                0.308      0.156      1.979      0.048

 ACC      ON
    SCMU              -0.469      0.314     -1.496      0.135
    SCMI              -0.346      0.270     -1.282      0.200

 SCMU     WITH
    SCMI               0.116      0.059      1.965      0.049

 Intercepts
    SCMU               2.428      0.321      7.577      0.000
    SCMI               2.901      0.442      6.558      0.000
    ACC                4.057      1.306      3.107      0.002

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.545      0.110      4.950      0.000
    ACC                1.862      0.376      4.950      0.000

STANDARDIZED MODEL RESULTS

STDYX Standardization

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

 SCMU     ON
    POS                0.409      0.123      3.310      0.001
    LMX                0.274      0.128      2.135      0.033

 SCMI     ON
    POS               -0.038      0.156     -0.244      0.807
    LMX                0.308      0.150      2.055      0.040

 ACC      ON
    SCMU              -0.215      0.141     -1.526      0.127
    SCMI              -0.185      0.142     -1.301      0.193

 SCMU     WITH
    SCMI               0.292      0.131      2.239      0.025

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               3.758      0.791      4.754      0.000
    ACC                2.808      0.822      3.417      0.001

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.915      0.076     11.990      0.000
    ACC                0.892      0.084     10.635      0.000

STDY Standardization

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

 SCMU     ON
    POS                0.480      0.142      3.390      0.001
    LMX                0.355      0.164      2.164      0.030

 SCMI     ON
    POS               -0.045      0.183     -0.244      0.807
    LMX                0.399      0.191      2.093      0.036

 ACC      ON
    SCMU              -0.215      0.141     -1.526      0.127
    SCMI              -0.185      0.142     -1.301      0.193

 SCMU     WITH
    SCMI               0.292      0.131      2.239      0.025

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               3.758      0.791      4.754      0.000
    ACC                2.808      0.822      3.417      0.001

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.915      0.076     11.990      0.000
    ACC                0.892      0.084     10.635      0.000

STD Standardization

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    POS               -0.034      0.141     -0.244      0.808
    LMX                0.308      0.156      1.979      0.048

 ACC      ON
    SCMU              -0.469      0.314     -1.496      0.135
    SCMI              -0.346      0.270     -1.282      0.200

 SCMU     WITH
    SCMI               0.116      0.059      1.965      0.049

 Intercepts
    SCMU               2.428      0.321      7.577      0.000
    SCMI               2.901      0.442      6.558      0.000
    ACC                4.057      1.306      3.107      0.002

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.545      0.110      4.950      0.000
    ACC                1.862      0.376      4.950      0.000

R-SQUARE

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

    SCMU               0.349      0.110      3.179      0.001
    SCMI               0.085      0.076      1.117      0.264
    ACC                0.108      0.084      1.292      0.196

QUALITY OF NUMERICAL RESULTS

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

TECHNICAL 1 OUTPUT

     PARAMETER SPECIFICATION

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           0             0             0             0             0

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             0             0
 SCMI               0             0             0             0             0
 ACC                0             0             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0
 SCMI               0             0
 ACC                0             0             0
 POS                0             0             0             0
 LMX                0             0             0             0             0

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           1             2             3             0             0

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             4             5
 SCMI               0             0             0             6             7
 ACC                8             9             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU              10
 SCMI              11            12
 ACC                0             0            13
 POS                0             0             0             0
 LMX                0             0             0             0             0

     STARTING VALUES

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         0.000         0.000         0.000         0.000         0.000

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           1.000         0.000         0.000         0.000         0.000
 SCMI           0.000         1.000         0.000         0.000         0.000
 ACC            0.000         0.000         1.000         0.000         0.000
 POS            0.000         0.000         0.000         1.000         0.000
 LMX            0.000         0.000         0.000         0.000         1.000

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000
 SCMI           0.000         0.000
 ACC            0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000         0.000         0.000         0.000         0.000
 SCMI           0.000         0.000         0.000         0.000         0.000
 ACC            0.000         0.000         0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.224
 SCMI           0.000         0.304
 ACC            0.000         0.000         1.066
 POS            0.000         0.000         0.000         0.725
 LMX            0.000         0.000         0.000         0.315         0.596

     Beginning Time:  14:43:04
        Ending Time:  14:43:04
       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

 

I also ran their structural model over again with indirect affects for anyone who is interested. Because I did not correct for their small sample size (and to be frank, I’m not entirely familiar with the strategy they took), the model fit is rather less than satisfactory (χ²(5) = 7.43, = .19, CFI = .92, TLI = .85, RMSEA = .10, and SRMR = .08) and the path coefficients are somewhat smaller (click to expand and view output):

Mplus VERSION 7.4 (Mac)
MUTHEN & MUTHEN
04/28/2017   6:56 PM

INPUT INSTRUCTIONS

  TITLE:
  	Sample summary data analysis on Hofmann & Morgeson 1999;
  DATA:
  	File is H&M1999.dat;
  	Type is MEANS STDEVIATIONS CORRELATION;
  	Nobservations = 49;
  	!they have uneven observations by variable, but we'll stick with 49

  VARIABLE:
  	names are POS LMX SCMU SCMI ACC AGE ORGT JOBT;
  	!POS = perceived org support
  	!LMX = leader-member exchange
  	!SCMU = safety communication
  	!SCMI = safety commitment
  	!ACC = accidents
  	!ORGT = org tenure
  	!JOBT = job tenure
  	usevariables = POS LMX SCMU SCMI ACC;

  	!H1&2: POS & LMX +r w/ SCMU
  	!H3&4: POS & LMX +r w/ SCMI
  	!H5: SCMU +r w/ SCMI
  	!H6&7: SCMU & SCMI -r w/ ACC

  ANALYSIS:
  	Estimator = ML;
  MODEL: !Now testing their structural model
  	SCMU on POS;
  	SCMU on LMX;
  	SCMI on SCMU;
  	ACC on SCMI;
  	POS with LMX;

  MODEL INDIRECT:
  	SCMI IND POS;
  	SCMI IND LMX;

  OUTPUT:
  	Standardized sampstat TECH1;

INPUT READING TERMINATED NORMALLY

Sample summary data analysis on Hofmann & Morgeson 1999;

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                          49

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

Observed dependent variables

  Continuous
   SCMU        SCMI        ACC

Observed independent variables
   POS         LMX

Estimator                                                       ML
Information matrix                                        EXPECTED
Maximum number of iterations                                  1000
Convergence criterion                                    0.500D-04
Maximum number of steepest descent iterations                   20

Input data file(s)
  H&M1999.dat

Input data format  FREE

SAMPLE STATISTICS

     SAMPLE STATISTICS

           Means/Intercepts/Thresholds
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           Covariances/Correlations/Residual Correlations
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.449
 SCMI           0.183         0.608
 ACC           -0.274        -0.296         2.132
 POS            0.311         0.074        -0.113         0.740
 LMX            0.246         0.176        -0.364         0.322         0.608

THE MODEL ESTIMATION TERMINATED NORMALLY

MODEL FIT INFORMATION

Number of Free Parameters                       15

Loglikelihood

          H0 Value                        -290.433
          H1 Value                        -286.718

Information Criteria

          Akaike (AIC)                     610.865
          Bayesian (BIC)                   639.242
          Sample-Size Adjusted BIC         592.172
            (n* = (n + 2) / 24)

Chi-Square Test of Model Fit

          Value                              7.429
          Degrees of Freedom                     5
          P-Value                           0.1907

RMSEA (Root Mean Square Error Of Approximation)

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

CFI/TLI

          CFI                                0.917
          TLI                                0.851

Chi-Square Test of Model Fit for the Baseline Model

          Value                             38.320
          Degrees of Freedom                     9
          P-Value                           0.0000

SRMR (Standardized Root Mean Square Residual)

          Value                              0.083

MODEL RESULTS

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    SCMU               0.407      0.156      2.615      0.009

 ACC      ON
    SCMI              -0.487      0.258     -1.885      0.059

 POS      WITH
    LMX                0.315      0.104      3.029      0.002

 Means
    POS                2.500      0.122     20.560      0.000
    LMX                3.000      0.110     27.202      0.000

 Intercepts
    SCMU               2.428      0.321      7.577      0.000
    SCMI               2.139      0.621      3.444      0.001
    ACC                2.740      0.986      2.779      0.005

 Variances
    POS                0.725      0.146      4.950      0.000
    LMX                0.596      0.120      4.950      0.000

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.523      0.106      4.950      0.000
    ACC                1.947      0.393      4.950      0.000

STANDARDIZED MODEL RESULTS

STDYX Standardization

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

 SCMU     ON
    POS                0.409      0.123      3.310      0.001
    LMX                0.274      0.128      2.135      0.033

 SCMI     ON
    SCMU               0.350      0.125      2.792      0.005

 ACC      ON
    SCMI              -0.260      0.133     -1.952      0.051

 POS      WITH
    LMX                0.480      0.110      4.366      0.000

 Means
    POS                2.937      0.329      8.919      0.000
    LMX                3.886      0.418      9.303      0.000

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               2.770      0.965      2.871      0.004
    ACC                1.896      0.641      2.956      0.003

 Variances
    POS                1.000      0.000    999.000    999.000
    LMX                1.000      0.000    999.000    999.000

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.877      0.088     10.000      0.000
    ACC                0.932      0.069     13.462      0.000

STDY Standardization

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

 SCMU     ON
    POS                0.409      0.123      3.310      0.001
    LMX                0.274      0.128      2.135      0.033

 SCMI     ON
    SCMU               0.350      0.125      2.792      0.005

 ACC      ON
    SCMI              -0.260      0.133     -1.952      0.051

 POS      WITH
    LMX                0.480      0.110      4.366      0.000

 Means
    POS                2.937      0.329      8.919      0.000
    LMX                3.886      0.418      9.303      0.000

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               2.770      0.965      2.871      0.004
    ACC                1.896      0.641      2.956      0.003

 Variances
    POS                1.000      0.000    999.000    999.000
    LMX                1.000      0.000    999.000    999.000

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.877      0.088     10.000      0.000
    ACC                0.932      0.069     13.462      0.000

STD Standardization

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    SCMU               0.407      0.156      2.615      0.009

 ACC      ON
    SCMI              -0.487      0.258     -1.885      0.059

 POS      WITH
    LMX                0.315      0.104      3.029      0.002

 Means
    POS                2.500      0.122     20.560      0.000
    LMX                3.000      0.110     27.202      0.000

 Intercepts
    SCMU               2.428      0.321      7.577      0.000
    SCMI               2.139      0.621      3.444      0.001
    ACC                2.740      0.986      2.779      0.005

 Variances
    POS                0.725      0.146      4.950      0.000
    LMX                0.596      0.120      4.950      0.000

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.523      0.106      4.950      0.000
    ACC                1.947      0.393      4.950      0.000

R-SQUARE

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

    SCMU               0.349      0.110      3.179      0.001
    SCMI               0.122      0.088      1.396      0.163
    ACC                0.068      0.069      0.976      0.329

QUALITY OF NUMERICAL RESULTS

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

TOTAL, TOTAL INDIRECT, SPECIFIC INDIRECT, AND DIRECT EFFECTS

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

Effects from POS to SCMI

  Total                0.130      0.065      2.002      0.045
  Total indirect       0.130      0.065      2.002      0.045

  Specific indirect

    SCMI
    SCMU
    POS                0.130      0.065      2.002      0.045

Effects from LMX to SCMI

  Total                0.096      0.059      1.630      0.103
  Total indirect       0.096      0.059      1.630      0.103

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.059      1.630      0.103

STANDARDIZED TOTAL, TOTAL INDIRECT, SPECIFIC INDIRECT, AND DIRECT EFFECTS

STDYX Standardization

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

Effects from POS to SCMI

  Total                0.143      0.069      2.084      0.037
  Total indirect       0.143      0.069      2.084      0.037

  Specific indirect

    SCMI
    SCMU
    POS                0.143      0.069      2.084      0.037

Effects from LMX to SCMI

  Total                0.096      0.057      1.674      0.094
  Total indirect       0.096      0.057      1.674      0.094

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.057      1.674      0.094

STDY Standardization

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

Effects from POS to SCMI

  Total                0.143      0.069      2.084      0.037
  Total indirect       0.143      0.069      2.084      0.037

  Specific indirect

    SCMI
    SCMU
    POS                0.143      0.069      2.084      0.037

Effects from LMX to SCMI

  Total                0.096      0.057      1.674      0.094
  Total indirect       0.096      0.057      1.674      0.094

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.057      1.674      0.094

STD Standardization

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

Effects from POS to SCMI

  Total                0.130      0.065      2.002      0.045
  Total indirect       0.130      0.065      2.002      0.045

  Specific indirect

    SCMI
    SCMU
    POS                0.130      0.065      2.002      0.045

Effects from LMX to SCMI

  Total                0.096      0.059      1.630      0.103
  Total indirect       0.096      0.059      1.630      0.103

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.059      1.630      0.103

TECHNICAL 1 OUTPUT

     PARAMETER SPECIFICATION

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           0             0             0             0             0

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             0             0
 SCMI               0             0             0             0             0
 ACC                0             0             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0
 SCMI               0             0
 ACC                0             0             0
 POS                0             0             0             0
 LMX                0             0             0             0             0

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           1             2             3             4             5

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             6             7
 SCMI               8             0             0             0             0
 ACC                0             9             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU              10
 SCMI               0            11
 ACC                0             0            12
 POS                0             0             0            13
 LMX                0             0             0            14            15

     STARTING VALUES

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         0.000         0.000         0.000         0.000         0.000

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           1.000         0.000         0.000         0.000         0.000
 SCMI           0.000         1.000         0.000         0.000         0.000
 ACC            0.000         0.000         1.000         0.000         0.000
 POS            0.000         0.000         0.000         1.000         0.000
 LMX            0.000         0.000         0.000         0.000         1.000

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000
 SCMI           0.000         0.000
 ACC            0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000         0.000         0.000         0.000         0.000
 SCMI           0.000         0.000         0.000         0.000         0.000
 ACC            0.000         0.000         0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.224
 SCMI           0.000         0.304
 ACC            0.000         0.000         1.066
 POS            0.000         0.000         0.000         0.370
 LMX            0.000         0.000         0.000         0.000         0.304

     Beginning Time:  18:56:59
        Ending Time:  18:56:59
       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

 

However, if you run the additional analyses they ran (controlling for organizational tenure), the model fit improves substantially (χ²(5) = 10.02, = .35, CFI = .97, TLI = .96, RMSEA = .05, and SRMR = .09) but the relationship between safety commitment and accidents is no longer significant (again, likely an issue with power due to small sample size):


Mplus VERSION 7.4 (Mac)
MUTHEN & MUTHEN
04/28/2017   7:20 PM

INPUT INSTRUCTIONS

  TITLE:
  	Sample summary data analysis on Hofmann & Morgeson 1999;
  DATA:
  	File is H&M1999.dat;
  	Type is MEANS STDEVIATIONS CORRELATION;
  	Nobservations = 49;
  	!they have uneven observations by variable, but we'll stick with 49

  VARIABLE:
  	names are POS LMX SCMU SCMI ACC AGE ORGT JOBT;
  	!POS = perceived org support
  	!LMX = leader-member exchange
  	!SCMU = safety communication
  	!SCMI = safety commitment
!ACC = accidents
  	!ORGT = org tenure
  	!JOBT = job tenure
  	usevariables = POS LMX SCMU SCMI ACC
  	ORGT;

  	!H1&2: POS & LMX +r w/ SCMU
  	!H3&4: POS & LMX +r w/ SCMI
  	!H5: SCMU +r w/ SCMI
  	!H6&7: SCMU & SCMI -r w/ ACC

  ANALYSIS:
  	Estimator = ML;
  MODEL: !Now testing their structural model
  	SCMU on POS;
  	SCMU on LMX;
  	SCMI on SCMU;
  	ACC on SCMI;
  	POS with LMX;
  	ACC on ORGT;

  MODEL INDIRECT:
  	SCMI IND POS;
  	SCMI IND LMX;

  OUTPUT:
  	Standardized sampstat TECH1;

INPUT READING TERMINATED NORMALLY

Sample summary data analysis on Hofmann & Morgeson 1999;

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                          49

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

Observed dependent variables

  Continuous
   SCMU        SCMI        ACC

Observed independent variables
   POS         LMX         ORGT

Estimator                                                       ML
Information matrix                                        EXPECTED
Maximum number of iterations                                  1000
Convergence criterion                                    0.500D-04
Maximum number of steepest descent iterations                   20

Input data file(s)
  H&M1999.dat

Input data format  FREE

SAMPLE STATISTICS

     SAMPLE STATISTICS

           Means/Intercepts/Thresholds
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           Means/Intercepts/Thresholds
              ORGT
              ________
      1        26.230

           Covariances/Correlations/Residual Correlations
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.449
 SCMI           0.183         0.608
 ACC           -0.274        -0.296         2.132
 POS            0.311         0.074        -0.113         0.740
 LMX            0.246         0.176        -0.364         0.322         0.608
 ORGT           0.127         0.963        -4.022         0.327         1.556

           Covariances/Correlations/Residual Correlations
              ORGT
              ________
 ORGT          90.250

THE MODEL ESTIMATION TERMINATED NORMALLY

MODEL FIT INFORMATION

Number of Free Parameters                       16

Loglikelihood

          H0 Value                        -288.612
          H1 Value                        -283.605

Information Criteria

          Akaike (AIC)                     609.224
          Bayesian (BIC)                   639.494
          Sample-Size Adjusted BIC         589.285
            (n* = (n + 2) / 24)

Chi-Square Test of Model Fit

          Value                             10.015
          Degrees of Freedom                     9
          P-Value                           0.3493

RMSEA (Root Mean Square Error Of Approximation)

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

CFI/TLI

          CFI                                0.966
          TLI                                0.955

Chi-Square Test of Model Fit for the Baseline Model

          Value                             42.090
          Degrees of Freedom                    12
          P-Value                           0.0000

SRMR (Standardized Root Mean Square Residual)

          Value                              0.088

MODEL RESULTS

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    SCMU               0.407      0.156      2.615      0.009

 ACC      ON
    SCMI              -0.423      0.249     -1.701      0.089
    ORGT              -0.040      0.020     -1.961      0.050

 POS      WITH
    LMX                0.315      0.104      3.029      0.002

 Means
    POS                2.500      0.122     20.560      0.000
    LMX                3.000      0.110     27.202      0.000

 Intercepts
    SCMU               2.429      0.321      7.577      0.000
    SCMI               2.139      0.621      3.444      0.001
    ACC                3.553      1.091      3.258      0.001

 Variances
    POS                0.725      0.146      4.950      0.000
    LMX                0.596      0.120      4.950      0.000

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.523      0.106      4.950      0.000
    ACC                1.808      0.365      4.950      0.000

STANDARDIZED MODEL RESULTS

STDYX Standardization

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

 SCMU     ON
    POS                0.409      0.123      3.310      0.001
    LMX                0.274      0.128      2.135      0.033

 SCMI     ON
    SCMU               0.350      0.125      2.792      0.005

 ACC      ON
    SCMI              -0.228      0.131     -1.744      0.081
    ORGT              -0.263      0.130     -2.028      0.043

 POS      WITH
    LMX                0.480      0.110      4.366      0.000

 Means
    POS                2.937      0.329      8.919      0.000
    LMX                3.886      0.418      9.303      0.000

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               2.770      0.965      2.871      0.004
    ACC                2.478      0.691      3.586      0.000

 Variances
    POS                1.000      0.000    999.000    999.000
    LMX                1.000      0.000    999.000    999.000

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.878      0.088     10.000      0.000
    ACC                0.879      0.086     10.219      0.000

STDY Standardization

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

 SCMU     ON
    POS                0.409      0.123      3.310      0.001
    LMX                0.274      0.128      2.135      0.033

 SCMI     ON
    SCMU               0.350      0.125      2.792      0.005

 ACC      ON
    SCMI              -0.228      0.131     -1.744      0.081
    ORGT              -0.028      0.014     -2.066      0.039

 POS      WITH
    LMX                0.480      0.110      4.366      0.000

 Means
    POS                2.937      0.329      8.919      0.000
    LMX                3.886      0.418      9.303      0.000

 Intercepts
    SCMU               3.662      0.769      4.765      0.000
    SCMI               2.770      0.965      2.871      0.004
    ACC                2.478      0.691      3.586      0.000

 Variances
    POS                1.000      0.000    999.000    999.000
    LMX                1.000      0.000    999.000    999.000

 Residual Variances
    SCMU               0.651      0.110      5.922      0.000
    SCMI               0.878      0.088     10.000      0.000
    ACC                0.879      0.086     10.219      0.000

STD Standardization

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

 SCMU     ON
    POS                0.318      0.102      3.110      0.002
    LMX                0.235      0.113      2.085      0.037

 SCMI     ON
    SCMU               0.407      0.156      2.615      0.009

 ACC      ON
    SCMI              -0.423      0.249     -1.701      0.089
    ORGT              -0.040      0.020     -1.961      0.050

 POS      WITH
    LMX                0.315      0.104      3.029      0.002

 Means
    POS                2.500      0.122     20.560      0.000
    LMX                3.000      0.110     27.202      0.000

 Intercepts
    SCMU               2.429      0.321      7.577      0.000
    SCMI               2.139      0.621      3.444      0.001
    ACC                3.553      1.091      3.258      0.001

 Variances
    POS                0.725      0.146      4.950      0.000
    LMX                0.596      0.120      4.950      0.000

 Residual Variances
    SCMU               0.286      0.058      4.950      0.000
    SCMI               0.523      0.106      4.950      0.000
    ACC                1.808      0.365      4.950      0.000

R-SQUARE

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

    SCMU               0.349      0.110      3.179      0.001
    SCMI               0.122      0.088      1.396      0.163
    ACC                0.121      0.086      1.405      0.160

QUALITY OF NUMERICAL RESULTS

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

TOTAL, TOTAL INDIRECT, SPECIFIC INDIRECT, AND DIRECT EFFECTS

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

Effects from POS to SCMI

  Total                0.130      0.065      2.002      0.045
  Total indirect       0.130      0.065      2.002      0.045

  Specific indirect

    SCMI
    SCMU
    POS                0.130      0.065      2.002      0.045

Effects from LMX to SCMI

  Total                0.096      0.059      1.630      0.103
  Total indirect       0.096      0.059      1.630      0.103

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.059      1.630      0.103

STANDARDIZED TOTAL, TOTAL INDIRECT, SPECIFIC INDIRECT, AND DIRECT EFFECTS

STDYX Standardization

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

Effects from POS to SCMI

  Total                0.143      0.069      2.084      0.037
  Total indirect       0.143      0.069      2.084      0.037

  Specific indirect

    SCMI
    SCMU
    POS                0.143      0.069      2.084      0.037

Effects from LMX to SCMI

  Total                0.096      0.057      1.674      0.094
  Total indirect       0.096      0.057      1.674      0.094

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.057      1.674      0.094

STDY Standardization

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

Effects from POS to SCMI

  Total                0.143      0.069      2.084      0.037
  Total indirect       0.143      0.069      2.084      0.037

  Specific indirect

    SCMI
    SCMU
    POS                0.143      0.069      2.084      0.037

Effects from LMX to SCMI

  Total                0.096      0.057      1.674      0.094
  Total indirect       0.096      0.057      1.674      0.094

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.057      1.674      0.094

STD Standardization

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

Effects from POS to SCMI

  Total                0.130      0.065      2.002      0.045
  Total indirect       0.130      0.065      2.002      0.045

  Specific indirect

    SCMI
    SCMU
    POS                0.130      0.065      2.002      0.045

Effects from LMX to SCMI

  Total                0.096      0.059      1.630      0.103
  Total indirect       0.096      0.059      1.630      0.103

  Specific indirect

    SCMI
    SCMU
    LMX                0.096      0.059      1.630      0.103

TECHNICAL 1 OUTPUT

     PARAMETER SPECIFICATION

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           0             0             0             0             0

           NU
              ORGT
              ________
      1           0

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             0             0
 SCMI               0             0             0             0             0
 ACC                0             0             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0
 ORGT               0             0             0             0             0

           LAMBDA
              ORGT
              ________
 SCMU               0
 SCMI               0
 ACC                0
 POS                0
 LMX                0
 ORGT               0

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0
 SCMI               0             0
 ACC                0             0             0
 POS                0             0             0             0
 LMX                0             0             0             0             0
 ORGT               0             0             0             0             0

           THETA
              ORGT
              ________
 ORGT               0

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1           1             2             3             4             5

           ALPHA
              ORGT
              ________
      1           0

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU               0             0             0             6             7
 SCMI               8             0             0             0             0
 ACC                0             9             0             0             0
 POS                0             0             0             0             0
 LMX                0             0             0             0             0
 ORGT               0             0             0             0             0

           BETA
              ORGT
              ________
 SCMU               0
 SCMI               0
 ACC               10
 POS                0
 LMX                0
 ORGT               0

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU              11
 SCMI               0            12
 ACC                0             0            13
 POS                0             0             0            14
 LMX                0             0             0            15            16
 ORGT               0             0             0             0             0

           PSI
              ORGT
              ________
 ORGT               0

     STARTING VALUES

           NU
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         0.000         0.000         0.000         0.000         0.000

           NU
              ORGT
              ________
      1         0.000

           LAMBDA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           1.000         0.000         0.000         0.000         0.000
 SCMI           0.000         1.000         0.000         0.000         0.000
 ACC            0.000         0.000         1.000         0.000         0.000
 POS            0.000         0.000         0.000         1.000         0.000
 LMX            0.000         0.000         0.000         0.000         1.000
 ORGT           0.000         0.000         0.000         0.000         0.000

           LAMBDA
              ORGT
              ________
 SCMU           0.000
 SCMI           0.000
 ACC            0.000
 POS            0.000
 LMX            0.000
 ORGT           1.000

           THETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000
 SCMI           0.000         0.000
 ACC            0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000
 ORGT           0.000         0.000         0.000         0.000         0.000

           THETA
              ORGT
              ________
 ORGT           0.000

           ALPHA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
      1         3.930         3.740         0.920         2.500         3.000

           ALPHA
              ORGT
              ________
      1        26.230

           BETA
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.000         0.000         0.000         0.000         0.000
 SCMI           0.000         0.000         0.000         0.000         0.000
 ACC            0.000         0.000         0.000         0.000         0.000
 POS            0.000         0.000         0.000         0.000         0.000
 LMX            0.000         0.000         0.000         0.000         0.000
 ORGT           0.000         0.000         0.000         0.000         0.000

           BETA
              ORGT
              ________
 SCMU           0.000
 SCMI           0.000
 ACC            0.000
 POS            0.000
 LMX            0.000
 ORGT           0.000

           PSI
              SCMU          SCMI          ACC           POS           LMX
              ________      ________      ________      ________      ________
 SCMU           0.224
 SCMI           0.000         0.304
 ACC            0.000         0.000         1.066
 POS            0.000         0.000         0.000         0.370
 LMX            0.000         0.000         0.000         0.000         0.304
 ORGT           0.000         0.000         0.000         0.000         0.000

           PSI
              ORGT
              ________
 ORGT          88.408

     Beginning Time:  19:20:15
        Ending Time:  19:20:15
       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

 

In any case, this is the kind of stuff you can do with Mplus! Enjoy!

References

Hofmann, D. A., & Morgeson, F. P. (1999). Safety-related behavior as a social exchange: The role of perceived organizational support and leader–member exchange. Journal of applied psychology, 84(2), 286-296.

Get [M]oving with Mplus – part 3: Get Your Data On

Unlike other programs like SPSS or Stata, data entry is done externally with Mplus. In other words, you will need to use another spreadsheet or stats program to transfer your data into Mplus. Typically I use SPSS because 1) it’s how I learned it and 2) it’s also the program I am most familiar with. But this can also be done, to the extent of my knowledge, from Stata and SAS (and probably others as well). In any case, I will review how to do it from SPSS (and others in the future!).


From SPSS:

  1. Acquire and open SPSS dataset you want to analyze in Mplus
  2. Transform missing data into a numeric indicator
  • Select Transform in the menu bar
  • Scroll down to and select Recode into same variable 
  • Select all your variables, move them into the numeric variables box
  • Select Old and New Values…
  • In the Old Value box select System-missing
  • In the New value box enter -999 (or any missing value identifier you prefer)
  • Press Add
  • Select Continue and then OK
  1. Double check format of columns (i.e., width, decimals, alignment)
  • Width = 8
  • Decimals = 2
  • Align = right
  • Short variable names (shoot for 5 characters or less, but definitely no more than 8)
  1. Save as Fixed ASCII (*.dat)
  • If there are variables in dataset you do not want to transfer, select pick variables button and select the variables you wish to save
  • REMEMBER ORDER OF VARIABLES! This is important because Mplus doesn’t know which line of numbers respresents what, so you need to tell it in the syntax.
  • Double check the .dat file in a text editor to make sure there are no issues with it
    • Some common issues:
      • 1) there are funky symbols in the top left corner of the .dat file that need to be removed
      • 2) there is no coherent spacing of numbers in the .dat (i.e., when you open the data file there is no discernable patterns and it’s a chaotic mess of numbers, letters, and symbols – there should be no letters or symbols! or variable names for that matter)
        • checking these can save you hours of troubleshooting
  • Save file in the same folder as your Mplus syntax (otherwise you would have to specify the full file path – by why not just store it in the same folder so you can just use the file name).
  1. Want to know a quick way to get your variable labels into Mplus?
  • To copy and paste variable names from SPSS, go to Utilities, select Variables…
  • Highlight the variables in your dataset for Mplus (if there were variables you didn’t transfer over, don’t forget to drop these) and press paste to have the variables sent to syntax.
  • Copy and paste into your Mplus syntax.

 

Transferring from other programs to come!

 

Get [M]oving with Mplus – part 2: A Serving of Commands with a Side of Syntax

You know the saying, “it’s not on the outside that matters, it what’s on the inside that counts”? Well, that’s certainly the case with Mplus. It’s time to get a taste of what Mplus really has to offer with it’s very simple and intuitive syntax.

A good place to start is a blank slate. When you open up a new syntax window, that’s what you get. Oftentimes I’ll copy an old syntax and just replace the details, but it’s typically a wise decision to get a sense of the required syntax and how it works so that you can quickly troubleshoot when the time comes when Mplus refuses to run.

Screen Shot 2017-04-25 at 23.32.42

Let’s get started with a few general notes (albeit very important notes – details matter in Mplus!):

  • All command headings/lines must be followed by a colon (:) and will turn blue
  • Subcommands and syntax lines must be followed by a semicolon (;)
  • Use an exclamation point (!) to make short notes that will turn green and Mplus does not read (note: if your note is not green, this means you forgot the exclamation point!)

Next, I’ll go through the command lines and their respective subcommands.

TITLE: ! command allows you to name or label what you are testing

Simply the best title ever;  ! This is an example title

! Helpful for keeping track of multiple analyses, although I often forget to change this!

DATA: ! command provides info about the dataset to be analyzed

! I will have a detailed post on getting your data into Mplus, but here are a couple helpful notes:

! Two types of data can be entered: individual data and summary data (see type subcommand below)

! Store data in the same folder as the Mplus syntax (for ease, otherwise must specify full path to file)

! Data Subcommands:

File is FILENAME.dat; ! Tells Mplus where the data file is stored

Type = !means stdeviations correlation; !can import individual or summary data, default is individual

Nobservations = !___; !this command tells MPlus # of observations when type = summary data

VARIABLE: ! command provides info about the variables in the dataset to be analyzed

!Names of variables MUST NOT exceed 8 characters

! Variable subcommands:

names are ! list your variables here; !this tells MPlus which variables are in the whole data set – you could also use the subcommand “Names=”

categorical are ! X1; ! describes type of variable, Mplus assumes variables are continuous unless told otherwise, can specify categorical, nominal, count, etc.

missing are all(-999); ! Must replace missing data with identifier (e.g., -999) before importing data

usevariables = ! list variables you want to use in analysis here;

!If variables are sequential you can simply place a hyphen between the first and last variables (e.g., for X1, X2, X3, X4 you can put X1-X4)

!If variables are created in define command below, add them to END of usevariables list

DEFINE: ! command used to transform existing variables and create new variables

! Define subcommands: you can…

! create new variables, “X12 = (X1 + X2)/2;” OR “X12 = mean(X1 X2);”

! create interaction terms, “int = X1*X2;”

! provide conditional statements, “IF (X1 EQ 1) THEN group = 1;” “IF (X1 EQ 2) THEN group = 2;” Mplus creates variable “group”

! make transformations,

! create parcels, X = mean(X1 X2 X3)

! center variables, “Center X1 X2 X3 (grandmean);”

ANALYSIS: ! command used to describe the nature of the analysis

! Analysis subcommands:

! Type = twolevel; ! nature of the model, default is general for typically don’t have to specify unless doing multilevel analysis (for SEM, regression)

! Estimator = ML; ! Tells Mplus which estimator you want to use, such as ML or Bayes

! Bootstrap = 10000; !Tells Mplus the number of bootstrap samples you want

MODEL: ! command used to describe the model to be estimated

!Three Fundamental commands:

! “ON”

! used to specify regression path (B matrix)

! Y on X1 X2; !regress Y on X1 and X1 or X1 and X2 predict Y

! “WITH”

! Used to specify covariance/correlation *double-headed arrow

! X1 with X2 !can be covariance between observed or latent variables

! “BY”

! Used to specify factor loadings

! X by X1 X2 X3;

! By default, first loading is fixed to 1.0 (similar to other programs)

!Some other things you can do under the model command:

!Constrain a parameter

! Y on X1@.25; ! Fixes regression weight of X1 to .25

! [X1@0]; ! Constrains X1 intercept to 0

! Label or name parameters/paths:

! M on X (a);

! Y on M (b);

! Y on X (c);

!These paths can then be used later for fun things in the model constrain command

!Constrain effects of IVs on DV to be equal:

!Y on X M (a);

MODEL CONSTRAINT: ! Command used for applying your labelled parameters

! Example: mediation using labelled parameters above

new (med total);

med = a*b; 

total = a*b+c;

MODEL INDIRECT: ! Command designed for testing mediation effects

! Mplus provides total and indirect effects (similar to PROCESS macro in SPSS)

! Combine with bootstrap option in analysis to get bootstrapped indirect effects

! If using Bayes estimator, do not use this, but rather use model constraint above

OUTPUT: ! Command used to request additional info not included in default

! Put all desired commands into a single line of syntax

! Popular output subcommand examples:

! standardized(all); !provides standardized estimates and standard errors

! sampstat; !provides sample statistics (e.g., sample means, (co)variances, correlations)

! modindices(all); !for SEM analyses, provides modification indices for model fit

! residual; !requests residuals for the observed variables in the model

! CInterval; request confidence (bootstrap)/credibility(HPD) intervals

! Tech1-16; Requests a variety of additional info on analysis

! Tech1; parameter specification and starting values

! Tech3; request estimated covariance and correlation matrices

! Tech4; means, covariances, correlations for latent variables

! Tech8; requests the optimization history in estimating the model (shows how long the analysis takes)

! See p.713+ of Mplus manual for other output subcommands

SAVEDATA: ! Command saves sample correlation and covariance matrices in separate ASCII file

! Savedata subcommands:

FILE IS output.sav;

! SAMPLE is output.sav; !speficies file name for sample statistics to be saved

! RESULTS ARE output.sav; !specifies name of file in which results of an analysis will be saved

!See p.744+ of manual for all save subcommands

PLOT: ! Command used to request graphical displays of observed data and results

! Plot subcommands:

! Type=PLOT1-3; used to specify types of plots (3 settings)

! PLOT1; see p. 763 in manual

! PLOT2; see p. 764

! PLOT3; see p. 765

!plot command does not work on Macs yet unfortunately, but I do have a how to guide for plotting Mplus outputs in R

So those are essentially the basic commands, subcommands, and a little bit of syntax. It may seem like a lot, but rarely will you need very much to run a single analysis. Here is an example of plausible input with a factor loading and a latent factor predicting an observed factor and a copy-and-paste basic template:

Screen Shot 2017-04-25 at 23.31.59

TITLE:
	ENTER TITLE HERE;

DATA:
	File is ENTERFILENAMEHERE.dat;

VARIABLE:
	names are ENTER VARIABLE NAMES HERE;

	missing are all(-999); !or whatever your missing value ID value is

	usevariables = ENTER VARIABLES TO BE USED;

ANALYSIS:
	estimator = ML;

MODEL:
	ENTER YOUR DESIRED ANALYSIS HERE
	! ON for regression
	! BY for factor analyses
	! WITH for correlation

OUTPUT:
	Standardized Sampstat;

Seems pretty straight forward, eh?

Get [M]oving with Mplus – part 1: The Painful Basics

When you open Mplus for the first time (see below), it kind of looks like something you would retrieve from a floppy disk. I wasn’t kidding when I said on the Mplus home page that it leaves a lot to the imagination! But paraphrasing the Canadian icon Steve Smith (aka Red Green), “If they don’t find you handsome, they should at least find you handy.” And well, Mplus sure is handy.

Screen Shot 2017-04-25 at 09.41.12

To get started, I’ll quickly review the plethora of icons on the screen above.  As you’ll notice, it’s all quite intuitive.

Screen Shot 2017-04-25 at 09.52.27New: Opens up a blank syntax window (you’ll see what this looks like shortly)

Screen Shot 2017-04-25 at 09.53.05Open: You can open inputs, outputs, and your data files with this

Screen Shot 2017-04-25 at 09.53.17Save: Mplus requires you to save your syntax before running analysis, so you use this quite a bit

Screen Shot 2017-04-25 at 10.01.01Cut: removes syntax but makes a copy of it (makes it easy to move things around)

Screen Shot 2017-04-25 at 09.53.28Copy: copies syntax (e.g., if you want to make a copy of your syntax in a new window)

Screen Shot 2017-04-25 at 09.53.36Paste: Pastes stuff that you cut or copied

Screen Shot 2017-04-25 at 09.53.46Print: I’ve never printed anything, but I assume it prints your selected syntax window

Screen Shot 2017-04-25 at 09.53.54Run: The mission launch button – selecting this runs your syntax

And that’s basically it for the button options. There is only one more useful thing I’d like to show you for the real basics. When running several analyses with separate syntax windows, the working space in Mplus can get pretty crowded quickly. Fortunately, there are some handy view options.

Now imagine you had the following workspace (imagine these syntax windows were full of beautiful syntax and lovely results because you’re a stellar researcher):

Screen Shot 2017-04-25 at 10.35.50

Messy, isn’t it? And that’s just four windows. On a laptop that could be all it takes to get you a little overwhelmed. The first step to getting your life back on track is selecting the View option in the command list.

Screen Shot 2017-04-25 at 10.36.14

Selecting Cascade Frames does the following:

Screen Shot 2017-04-25 at 10.36.54

Selecting Tile Frames Vertically

Screen Shot 2017-04-25 at 10.37.12

Selecting Tile Frames Horizontally

Screen Shot 2017-04-25 at 10.37.31

 

And that’s about it for the real basics. All quite straightforward and intuitive – fortunately a trend in Mplus that goes right into the next topics of writing syntax and running analyses.

Getting Sta[R]ted with R!

First things, first

Install R & Rstudio!

Rstudio runs R while providing the user with a much more friendly environment to work with. Besides, most people who use R, use Rstudio.

Second things… second?

Be aware that there are a lot of resources available online. Given that this software is open-source, R has a thriving community of keeners. In addition, I was told that Andy Field’s book, Discovering Statistics using R is very good! Here are a few other helpful examples:

More to come…!

Examining the interface of R and R studio and other basics to get you started!

Leadership is tied to employee well-being through this subjective experience

blog-5-pic

(Photo via http://geracaodevalor.com/)

In a study by Arnold, Turner, Barling, Kelloway & McKee (2005), they examined the link between the most sought after form of leadership, called transformational leadership, and employee well-being. Transformational leadership is somewhat complex, but essentially consists of four key features:

A transformational leader is someone who has the ability to…

(1) …provide individual consideration to her or his employees

(2) …inspire and motivate her or his employees to challenge themselves

(3) …encourage employees to seek out their own answers by challenging the status quo

(4) …model ethical behaviour by doing “the right thing” when the occasion calls

Arnold and colleagues reasoned that the link between transformational leadership and employee well-being would be the ability of leaders to enhance an employee’s subjective experience that their work has meaning and purpose.

This is how they proposed it would work:

blog5-entry-pic

And that is exactly what they found.  Which is great news because transformational leadership is something that can be improved through training.

More recent research has also boosted confidence in these findings by overcoming many of the limitations in this study.

  • Directionality: A longitudinal study (i.e., research that involves measurements that occur over time) has found evidence for the direction of the findings (i.e., leadership leads to meaningfulness which leads to well-being, rather than well-being to meaningfulness to leadership).
  • Single source & other factors: A review of the literature helps overcome the fact that the data in this study were collected from a single source and that several other potential factors were not measured, such as personality.

Take home message: Leader/manager/supervisor/boss/etc (albeit, not always synonymous) behaviour has important consequences on their employees’ well-being (among other things!). It is important for leaders to recognize this and take an honest self-evaluation. To do this effectively, the transformational framework provides an ideal checklist.

Saving little Tommy and his three-legged dog, Scout, and other potential realities

Blog 4 pic

(Photo via Steve Granger)

I recently listened to the thought and action provoking conversation between the philosopher, William MacAskill, and author, Sam Harris, on the Waking Up podcast, which I highly recommend (unless, as I ruefully learned, you’re about to go do some back-to-school clothes shopping – you’ll get why shortly).  They discussed arguments for what is called effective altruism.  Effective altruism is the idea that we should apply reason and evidence to maximize our attempts at making the world a better place.

For most of us, we are in the advantageous position to do a great deal of good.  We can save a life right now.  Seriously.  Imagine the story you would have if you were out for a night-on-the-town and you pulled someone away from getting hit by a distracted driver – or the tale you would recite if you ran into a burning building and saved a little child and his three-legged dog.  As MacAskill and Harris conclude, we are in a position to reach out or run in whenever we want!

But then the questions start to roll in.  Who or what organization should we give to?  How much should we give?  How can I truly maximize the good I do?  Luckily the effective altruism movement has answers for these and many more questions: http://www.givewell.org/

The key takeaway for me is this: Giving shouldn’t necessarily be seen as an obligation, but an opportunity.  It’s easy to get overwhelmed by the “maximize the common good” mindset – where luxury is a sin and being a hypocrite is unavoidable (e.g., getting new clothes when your old ones are perfectly fine!).  Many get paralyzed by this approach.  They turn inward by putting up a wall of distrust and self-preservation.  They lash outward by reproaching those who express benevolent inclinations and dismiss them as virtue signals.  Ultimately, they give less than they would have in hindsight.

Yet it has never been so easy to reach out.  If we simply change how we think and reason about giving, we could do so much more.  That’s why I wanted to share this conversation between MacAskill and Harris, and the idea of effective altruism.  As Harris points out in his postscript, it is not so often that we can share ideas that have such immediate consequences.