Announcement

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

  • Results from gsem are not consistent?

    I'm trying to test mediation effects with gsem, but my total effects aren't adding up correctly. If I have a binary outcome and treat it as linear, things are okay:

    Code:
    sysuse auto
    gsem (trunk -> mpg)(trunk mpg -> foreign)
    nlcom _b[mpg:trunk]*_b[foreign:mpg] + _b[foreign:trunk] = -.0386701
    // Indirect + direct = total
    This total effect is the same as:
    Code:
    gsem (trunk -> foreign) = -.0386701 √
    However, if I use
    logit, the total effect from the mediation model is different from the total effect from the simple model.
    Code:
    gsem (trunk -> mpg)(trunk mpg -> foreign)
    nlcom _b[mpg:trunk]*_b[foreign:mpg] + _b[foreign:trunk] = -.2149484
    
    vs.
    
    gsem (trunk -> foreign, logit)
    lincom _b[foreign:trunk] = -.2092823
    This makes me unsure which to use for the denominator when I calculate % mediated as indirect effect over total effect.
    Code:
    sysuse auto
    gsem (trunk -> mpg)(trunk mpg -> foreign, logit)
    nlcom (_b[mpg:trunk]*_b[foreign:mpg]) / -.2149484  = 39.6%
    
    or
    
    nlcom (_b[mpg:trunk]*_b[foreign:mpg]) / -.2092823 = 40.7%
    These differences might not seem like much, but in the actual data I'm working with, the difference can be large. Any advice?







  • #2
    Hi Max, how do you solve this issue? I have the same problem. Looking forward to your advice

    Comment


    • #3
      Unless you are dealing with random intercepts or slopes, I would personally not use gsem for these analyses. Instead, I would suggest Hicks & Tingley's (2011) mediation program and the associated medeff and medsense commands. medeff can handle mediators and outcomes that are binary and medsens produces sensitivity analyses that tell you how large a common cause of M and Y would have to be to eliminate the observed mediation effect.
      Code:
      net sj 12-2 st0243_1

      Comment


      • #4
        If you have a binary outcome variable, I would suggest the KHB approach.

        https://www.stata.com/meeting/german...g11_kohler.pdf

        https://gitup.uni-potsdam.de/ukohler/khb
        Best wishes

        (Stata 16.1 MP)

        Comment

        Working...
        X