# \donttest{
data(cachar_sample)
# Calculate IPTW weights
iptw_result <- calc_iptw_weights(
data = cachar_sample,
treatment = "areca_nut",
covariates = c("age", "sex", "residence", "smoking")
)
# Create balance plots
if (requireNamespace("ggplot2", quietly = TRUE)) {
plots <- create_balance_plots(iptw_result, plot_type = "both")
print(plots$love_plot)
print(plots$ps_plot)
}
# }
Run the code above in your browser using DataLab