
UNADJ binary estimator: unadjusted logistic / linear-probability regression
Source:R/bin_estimators.R
fit_unadj_bin.RdRegresses the binary outcome on the exposure X (plus covariates) with no instrument or negative-control adjustment. Bias reference.
Usage
fit_unadj_bin(y, X, covars = NULL, effect_scale = c("logor", "riskdiff"))Details
When effect_scale = "logor" (default), fits a logistic
regression and returns the conditional log-odds ratio for X. When
effect_scale = "riskdiff", fits a linear probability model
(OLS on the 0/1 outcome), returning a risk difference — a
collapsible, linear alternative to the non-collapsible odds ratio.
Examples
set.seed(1)
dat <- generate_toy_data(n = 200, outcome_type = "binary", seed = 1)
fit_unadj_bin(dat$y_bin, dat$X)
#> $beta
#> [1] 0.4066461
#>
#> $se
#> [1] 0.1527228
#>
#> $pvalue
#> [1] 0.007752997
#>
fit_unadj_bin(dat$y_bin, dat$X, effect_scale = "riskdiff")
#> $beta
#> [1] 0.09560984
#>
#> $se
#> [1] 0.03461115
#>
#> $pvalue
#> [1] 0.006278234
#>