
PGC binary estimator: proxy G-component correction with logistic / LPM
Source:R/bin_estimators.R
fit_pgc_bin.RdThree-step bridge-function estimator with a binary outcome stage:
Residualise X on G -> X_resid (OLS).
Bridge X_resid on the FULL W matrix -> W_hat (OLS).
Regress the binary outcome on X + W_hat via logistic regression (log-OR) or a linear probability model (risk difference).
Usage
fit_pgc_bin(y, X, g, W, covars = NULL, effect_scale = c("logor", "riskdiff"))Examples
set.seed(1)
dat <- generate_toy_data(n = 200, outcome_type = "binary", seed = 1)
fit_pgc_bin(dat$y_bin, dat$X, dat$G[, 1], dat$W)
#> $beta
#> [1] 0.2603184
#>
#> $se
#> [1] 0.1982229
#>
#> $pvalue
#> [1] 0.189095
#>