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