attrition: Overall and differential attrition

View source: R/summary.R

attritionR Documentation

Overall and differential attrition

Description

Computes overall and differential sample attrition for a two-group design, the inputs to the What Works Clearinghouse (WWC) attrition standard. Differential attrition is the absolute difference between the treatment and comparison attrition rates.

Usage

attrition(treatment, retained, na.rm = TRUE)

Arguments

treatment

Vector identifying group membership; exactly two unique non-missing values (the larger is treated as the treatment group, as in hedges_g()).

retained

Logical (or 0/1) the same length as treatment: TRUE/1 for cases retained in the analytic sample, FALSE/0 for those lost.

na.rm

Logical; drop rows where treatment or retained is NA. Default TRUE.

Details

This function reports the attrition rates; it does not classify them. Compare the overall and differential rates against the WWC attrition boundary for your chosen response assumption (cautious or optimistic) in the Procedures Handbook.

Value

A one-row data frame with columns attrition_overall, attrition_treatment, attrition_comparison, and differential_attrition (all proportions).

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

set.seed(1)
g <- rep(c(1, 0), each = 100)
kept <- rbinom(200, 1, ifelse(g == 1, 0.9, 0.8))
attrition(g, kept)


baselinr documentation built on July 8, 2026, 9:07 a.m.