
Difference-in-coefficients mediation estimator
Source:R/audit_native.R
morie_mediation_difference.Rd\(c - c'\). For a continuous OLS outcome this equals \(ab\)
EXACTLY in every sample, not merely in expectation, so a non-zero
identity_residual means the two models were not fitted on the same
rows – usually listwise deletion dropping different cases.
Details
The identity fails for logistic or probit outcomes for a structural reason: those coefficients are identified only up to scale, and conditioning on the mediator changes the residual variance and hence the scale. That is non-collapsibility, not sampling error.
Examples
morie_mediation_difference(c = 0.5, c_prime = 0.3)
#> $indirect
#> [1] 0.2
#>
#> $total
#> [1] 0.5
#>
#> $direct
#> [1] 0.3
#>
#> $proportion_mediated
#> [1] 0.4
#>
#> $product
#> NULL
#>
#> $identity_residual
#> NULL
#>
#> $matches_product
#> NULL
#>
#> $method
#> [1] "Difference-in-coefficients indirect effect"
#>