
Doubly-robust ATT combining matching and regression
Source:R/matching.R
morie_matching_doubly_robust.RdMatches on the propensity score, then applies bias-corrected linear regression adjustment within the matched sample. Standard errors come from a non-parametric bootstrap.
Usage
morie_matching_doubly_robust(
data,
outcome,
treatment,
covariates,
ps = NULL,
n_bootstrap = 200L,
seed = 42L,
alpha = 0.05
)Arguments
- data
Data frame.
- outcome, treatment
Column names.
- covariates
Character vector of covariates.
- ps
Optional propensity scores. When supplied they REPLACE the fitted model and become the matching distance directly, aligned to the rows that survive the NA drop.
- n_bootstrap
Number of bootstrap replications.
- seed
Random seed.
- alpha
Significance level.
Examples
# \donttest{
set.seed(1)
df <- data.frame(y = rnorm(200), d = rbinom(200, 1, 0.4),
x1 = rnorm(200), x2 = rnorm(200))
morie_matching_doubly_robust(df, "y", "d", c("x1", "x2"),
n_bootstrap = 50) # 50 keeps the example fast
#> $estimand
#> [1] "ATT_DR"
#>
#> $estimate
#> [1] -0.08345709
#>
#> $std_error
#> [1] 0.1524123
#>
#> $ci_lower
#> [1] -0.3821796
#>
#> $ci_upper
#> [1] 0.2152654
#>
#> $p_value
#> [1] 0.583984
#>
#> $n_obs
#> [1] 174
#>
#> $details
#> $details$n_bootstrap
#> [1] 50
#>
#> $details$n_successful_boots
#> [1] 50
#>
#>
#> attr(,"class")
#> [1] "morie_te_result" "list"
# }