Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculation of SE and p-values for complete indirect paths using SEM (similar to binary_mediation)

    Hi,
    I am doing a mediation analysis using the SEM command (or the builder, both are fine) with only observed variables.
    Using estat teffects I get all the "simple" (a and b paths) direct and indirect effects and their related p-values, but I would like a p-value for a test of the "complete" paths (from the predictor through the mediator to the outcome). I know that if one of the simple indirect paths are insignificant, the complete path won't be either, but I would still like an estimate, SE and p-value for these complete path.

    For a simple example:
    My command is: sem (lei <- sep sex age) (al <- let sp sex age)

    That is, I am testing whether the effect of sep on al is mediated by lei, with sex and age as covariates.
    Using estat teffects I get paths and p-values from sep to lei and from lei to al, and of course by multiplying these I can get the complete indirect effects but no p-value.
    Is there some bootstrap-procedure I can use to get this?

    For those of you familiar with the user-written binary_mediation command, there is a bootstrap-option that does this - the problem is, I need to use SEMs FIML option.

    Please let me know if you need any more info to help me and thank you in advance.

  • #2
    Use nlcom for nonlinear test (indirect paths). Here is a quick example with artificial data followed by bootstrapping the nonlinear effect:

    Code:
    sem (lei <- sep sex age) (al <- lei sep sex age),
    
    
    Structural equation model                       Number of obs     =      1,000
    Estimation method  = ml
    Log likelihood     = -1457.8648
    
    ------------------------------------------------------------------------------
                 |                 OIM
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    Structural   |
      lei <-     |
             sep |   .0731329   .0319451     2.29   0.022     .0105218    .1357441
             sex |   .0092227   .0183664     0.50   0.616    -.0267749    .0452203
             age |  -.0601395   .0316345    -1.90   0.057     -.122142     .001863
           _cons |   .4835566    .026982    17.92   0.000     .4306728    .5364403
      -----------+----------------------------------------------------------------
      al <-      |
             lei |  -.0158457   .0323121    -0.49   0.624    -.0791762    .0474848
             sep |   .0495867   .0327268     1.52   0.130    -.0145567      .11373
             sex |    .000865   .0187692     0.05   0.963    -.0359219    .0376519
             age |  -.0116921   .0323824    -0.36   0.718    -.0751606    .0517763
           _cons |   .4700953   .0316898    14.83   0.000     .4079845    .5322062
    -------------+----------------------------------------------------------------
       var(e.lei)|   .0839667   .0037551                      .0769201    .0916587
        var(e.al)|   .0876671   .0039206                        .08031    .0956981
    ------------------------------------------------------------------------------
    LR test of model vs. saturated: chi2(0)   =      0.00, Prob > chi2 =      .
    
    
    // Do the non-linear indirect paths test:
    
    nlcom _b[lei:sep]*_b[al:lei]
    
           _nl_1:  _b[lei:sep]*_b[al:lei]
    
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _nl_1 |  -.0011588   .0024167    -0.48   0.632    -.0058955    .0035778
    ------------------------------------------------------------------------------
    
    //For Bootstrapping the non-linear effect:
    
    capture program drop boots
        program boots, rclass
        sem (lei <- sep sex age) (al <- lei sep sex age),
        return scalar est1 =  _b[lei:sep]*_b[al:lei]
    end
    
    bootstrap r(est1), reps(15) : boots //Use your own number of replications, for demostration purpose 15 is given here.
    
    
    Bootstrap replications (15)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
    ...............
    
    Bootstrap results                               Number of obs     =      1,000
                                                    Replications      =         15
    
          command:  boots
            _bs_1:  r(est1)
    
    ------------------------------------------------------------------------------
                 |   Observed   Bootstrap                         Normal-based
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _bs_1 |  -.0011588   .0021683    -0.53   0.593    -.0054086    .0030909
    ------------------------------------------------------------------------------





    Roman

    Comment


    • #3
      Thank you so much Roman! I will try it for myself when I have my data tomorrow. Is this a user-written command or do you know where I might find more info about this?

      Comment


      • #4
        Okay found it, sorry I can't seem to find anything about using the mlmv method option for this - do you know if they are compatible if I use mlmv in the first sem command?
        Last edited by Anne Chistensen; 16 May 2017, 02:44.

        Comment


        • #5
          Just use the 'mlmv' option after the 'sem' command.
          Roman

          Comment

          Working...
          X