
PGC mediation estimator: bridge-function-adjusted natural effects (scalar bridge)
Source:R/mediation.R
fit_pgc_scalar_mediation.RdThe original ICONIC PGC mediation implementation, which summarises the
negative-control panel as a scalar (rowMeans(W)) before bridging.
Like fit_pgc_scalar, this version is algebraically
equivalent to the IV2SLS mediation estimator when the instrument is
valid. Use fit_pgc_mediation (matrix bridge) when the
completeness condition is of interest.
Examples
set.seed(1)
dat <- generate_toy_data(n = 200, mo_confounding = 0.8, seed = 1)
fit_pgc_scalar_mediation(dat$Y[, 1], dat$X, dat$M, dat$G[, 1], rowMeans(dat$W))
#> $NDE
#> [1] -0.3304709
#>
#> $NDE_se
#> [1] 0.04147903
#>
#> $NDE_p
#> [1] 1.300326e-13
#>
#> $NIE
#> [1] 0.6425387
#>
#> $NIE_se
#> [1] 0.04652626
#>
#> $NIE_p
#> [1] 2.211053e-43
#>
#> $alpha_M
#> [1] 0.5454283
#>
#> $alpha_se
#> [1] 0.02684247
#>
#> $beta_M
#> [1] 1.178044
#>
#> $beta_M_se
#> [1] 0.06257225
#>