View source: R/iptw_diagnostics.R
check_iptw_assumptions | R Documentation |
Provides diagnostic checks for key IPTW assumptions including positivity, balance, and model specification. Returns a comprehensive summary with recommendations for potential issues.
check_iptw_assumptions(
iptw_result,
balance_threshold = 0.1,
extreme_weight_threshold = 10,
verbose = TRUE
)
iptw_result |
An iptw_result object from calc_iptw_weights() |
balance_threshold |
Threshold for acceptable standardized difference (default: 0.1) |
extreme_weight_threshold |
Threshold for flagging extreme weights (default: 10) |
verbose |
Whether to print detailed diagnostics (default: TRUE) |
A list containing:
Character indicating "PASS", "CAUTION", or "FAIL"
List with positivity checks and recommendations
List with balance assessment and problematic variables
List with weight distribution diagnostics
Character vector of specific recommendations
data(cachar_sample)
iptw_result <- calc_iptw_weights(
data = cachar_sample,
treatment = "areca_nut",
covariates = c("age", "sex", "residence", "smoking")
)
# Check assumptions
assumptions <- check_iptw_assumptions(iptw_result)
print(assumptions$overall_assessment)
print(assumptions$recommendations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.