Skip to contents

Estimates the Average Treatment Effect on the Controls. Uses the explicit _matched suffix to distinguish it from the IPW estimator morie_estimate_atc in causal.R.

Usage

morie_matching_atc_matched(data, outcome, treatment, match_pairs, alpha = 0.05)

Arguments

data

Data frame.

outcome

Outcome column name.

treatment

Binary treatment column name.

match_pairs

Data frame with columns treated_idx and control_idx.

alpha

Significance level for confidence intervals.

Value

A list of class morie_te_result.

Examples

# \donttest{
set.seed(1)
df <- data.frame(y = rnorm(200), d = rbinom(200, 1, 0.4),
                 x1 = rnorm(200), x2 = rnorm(200))
res <- morie_matching_nearest_neighbor(df, "d", c("x1", "x2"))
morie_matching_atc_matched(df, "y", "d", res$match_pairs)
#> $estimand
#> [1] "ATC"
#> 
#> $estimate
#> [1] -0.1000929
#> 
#> $std_error
#> [1] 0.1316426
#> 
#> $ci_lower
#> [1] -0.3581077
#> 
#> $ci_upper
#> [1] 0.1579219
#> 
#> $p_value
#> [1] 0.4470526
#> 
#> $n_obs
#> [1] 87
#> 
#> $details
#> list()
#> 
#> attr(,"class")
#> [1] "morie_te_result" "list"           
# }