
DIRECT binary estimator: logistic / LPM with instrument and NC covariates
Source:R/bin_estimators.R
fit_direct_bin.RdRegresses the binary outcome on X plus the genetic instrument G, the negative-control panel W, and covariates. Naive adjustment; does not correct for unmeasured confounding via a ratio or IV approach.
Usage
fit_direct_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_direct_bin(dat$y_bin, dat$X, dat$G[, 1], dat$W[, 1])
#> $beta
#> [1] 0.5398956
#>
#> $se
#> [1] 0.2533408
#>
#> $pvalue
#> [1] 0.03308055
#>