Announcement

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

  • Mediation using GSEM or SEM for Categorial IV

    I am working with mediation models where I have two mediators in parallel (M1 and M2), and the outcome variable (DV) is either continuous (in which case I use SEM), or binary (in which case I use GSEM, with the "family(binomial) link(logit)" option. No issues there.

    My question is about the independent variable (IV), which is categorical with 3 levels. Specifically, my IV is a workgroup varying in gender composition ("gcomp") comprising either all women ("ww", coded 0), all men ("mm", coded 1), or a mixed-gender group ("mix", coded 2). Thus, my IV is labeled "gcomp_0ww1mm2mix".

    If I attempt mediation and boostrapping of indirect effects with this 3-category IV (see my code below), the results are relatively meaningless, because the output speaks to a "general effect" of the IV and it is not clear which effect is being compared exactly (is the effect of the all-men vs. all-women group? Mixed-gender vs. all-women? etc.).

    The obvious solution is to split my dataset into three subsets, in which I drop one of the IV categories in each subset and focus on a binary IV in each case to ease interpretation of results (i.e., where the IV is either (a) gcomp_0ww1mm, (b) gcomp_0ww1mix, or (c) gcomp_0mm1mix)). However, this three dataset approach is a bit tedious.

    Is there any way for Stata to provide significance of the indirect effects (via bootstrapping) through each of the two mediators, comparing ALL three possible combinations of levels of IV (i.e. ww vs. mm, ww vs. mix, and mm vs. mix)? Simply indicating that the IV is categorical (.i) only compares the base group that is coded as 0 with the other two groups, but it does not automatically also compare the two other groups with each other.

    Currently my code looks like the below, but again, the output is "generalized", and I do not know what would be the appropriate options or post-estimation commands to systematically compare pairs of the three groups. I believe in SPSS, the Process module allows for comparisons of the different effects when looking at mediation with a categorical IV, but not sure how to do this in Stata. Any input would be great. Thank you!

    Code:
    gsem (m1 <- iv)(m2 <- iv)(dv <- iv m1 m2, family(binomial) link(logit))
    
    capture program drop boot1      
    program boot1, rclass
    gsem (m1 <- iv)(m2 <- iv)(dv <- iv m1 m2, family(binomial) link(logit))
    return scalar indeffect_via_m1 = [m1]_b[iv]*[dv]_b[m1]
    return scalar indeffect_via_m2 = [m2]_b[iv]*[dv]_b[m2]
    return scalar indeffect_total = [m1]_b[iv]*[dv]_b[m1] + [m2]_b[iv]*[dv]_b[m2]
    end
    bootstrap r(indeffect_via_m1) r(indeffect_via_m2) r(indeffect_total), reps(1000) : boot1
    estat boot, bc percentile
    Last edited by In Hu; 21 Nov 2018, 10:59.
Working...
X