data(cachar_sample)
# Standard ATE estimation
rd_iptw <- calc_risk_diff_iptw(
data = cachar_sample,
outcome = "abnormal_screen",
treatment = "areca_nut",
covariates = c("age", "sex", "residence", "smoking")
)
print(rd_iptw)
# ATT estimation with bootstrap CI
rd_att <- calc_risk_diff_iptw(
data = cachar_sample,
outcome = "head_neck_abnormal",
treatment = "tobacco_chewing",
covariates = c("age", "sex", "residence", "areca_nut"),
weight_type = "ATT",
bootstrap_ci = TRUE,
boot_n = 500
)
print(rd_att)
Run the code above in your browser using DataLab