ipw_ate: Etimate average treatment effect (ATE) with inverse...

Description Usage Arguments Details Value References Examples

View source: R/ate.R

Description

Etimate average treatment effect (ATE) with inverse propensity score weighting.

Usage

1
ipw_ate(data, y, w, p, cf = T)

Arguments

data

a dataframe object containing the variables and values.

y

a character vector specifying the response variable.

w

a character vector specifying the treatment status.

p

a vector containing propensity score values.

cf

logical; if TRUE then includes confidence interval on ATE.

Details

Computes an estimate of the ATE τ using propensity score weighting:

τ = E ≤ft[ \frac{Y_i W_i}{e(X_i)} - \frac{Y_i (1 - W_i)}{1 - e(X_i)} \right]

where e(X_i) = P(W_i = 1 | X_i = x) is the propensity score.

Value

a list of ATE, 95 percent confidence interval upperbound and lowerbound or just ATE, depending on user input of cf

References

Robins, James M., Andrea Rotnitzky and Lue Ping Zhao. 1994. "Estimation of Regression Coefficients When Some Regressors Are Not Always Observed." Journal of the American Statistical Association. Vol. 89(427), Sep., pgs. 846-866. https://doi.org/10.1080/01621459.1994.10476818 Lunceford JK, Davidian M. 2004. “Stratification and weighting via the propensity score in estimation of causal treatment effects: a comparative study." Statistics in Medicine. Vol. 23(19), Aug., pgs. 2937–2960. https://doi.org/10.1002/sim.1903

Examples

1
2
3
4
5
data("lalonde")

# calculate propensity scores
p <- propensity_score(data = lalonde, y = "re78", w = "treat", model = "logistic")
ate <- ipw_ate(data = lalonde, y = "re78", w = "treat", p = p)

jackcollison/causality documentation built on Dec. 20, 2021, 8:05 p.m.