Skip to content

attrition

1.0.0Package record

Addressing Nonignorable Attrition with Double Sampling and Bounds

0packages depend
563downloads / year
100.0%test coverage
13/13flavors OK

Overview

About

Implements the double-sampling bounds estimator of Coppock, Gerber, Green, and Kern (2017) doi:10.1017/pan.2016.6 for randomized experiments with nonignorable missing outcomes. Provides worst-case (Manski) bounds, double-sampling bounds with analytic variance and Imbens-Manski confidence intervals, Lee (2009) doi:10.1111/j.1467-937X.2009.00536.x trimming bounds with analytic and bootstrap standard errors, covariate adjustment via poststratification, and a sensitivity analysis for violations of the outcome stability assumption.

Changes in 1.0.0

First release. The package implements the estimators of Coppock, Gerber, Green, and Kern (2017) for randomized experiments with nonignorable missing outcomes.

Estimators

  • estimator_ev(): worst-case (Manski 1990) bounds from a single round of data collection, with a joint Imbens-Manski (2004) confidence interval.
  • estimator_ds(): the double-sampling bounds of the paper, with its analytic variance. A random sample of the initial nonrespondents is pursued a second time, and only the subjects who refuse twice get worst-case treatment.
  • estimator_ds_sens() and sensitivity_ds(): the interpolation between worst-case bounds and ignorability, indexed by delta, the share of follow-up nonrespondents left unmodeled, and a sweep over delta for delta*, the smallest value at which the confidence interval reaches zero.
  • estimator_trim(): trimming bounds on the effect among always-reporters. The design and the selection assumption are separate choices. Which response arguments are supplied picks the design, single sample (R) or double sampling (R1, Attempt, R2); monotonicity picks the assumption, "treatment_increases_response" (Lee 2009), "treatment_decreases_response", or "none", which gives the sharp bounds of Imai (2008, Proposition 1) under random assignment alone. All four combinations estimate. Standard errors come from Lee (2009, Proposition 3) where that derivation applies, which is the single-sample, one-group-trimmed case, and from a bootstrap resampled within treatment arm everywhere else; asking for analytic standard errors where they do not apply is an error rather than a silent substitution.
  • estimator_ev(), estimator_ds(), estimator_ds_sens() and sensitivity_ds() take a strata argument for poststratification on a discrete covariate, which targets the same identification region and estimates it more precisely.

Output

  • Every estimator returns the same six named elements in the same order, under broom's names: estimate_lower and estimate_upper, the two ends of the identification region; std.error_lower and std.error_upper, their standard errors; and conf.low and conf.high, the joint Imbens-Manski interval. estimator_trim() follows them with the intermediate quantities of the path taken.
  • print(), summary() and tidy() methods for every result. summary() names the estimand and the assumptions that produced the numbers; for trimming bounds that includes the design, the direction assumed, how much of which group was trimmed, and where the standard errors came from. tidy() returns a three-row tibble, a bounds row carrying the whole vector and a row per endpoint, so DeclareDesign::declare_estimator() can select an endpoint with term. sensitivity_ds() returns a classed list whose print() reports delta* and whose tidy() returns the bounds at every value of delta.
  • A formula interface on every estimator, estimator_ds(Y ~ Z, R1 = "R1", Attempt = "Attempt", R2 = "R2", ...), which is what declare_estimator(.method = ...) expects. Response, attempt and stratification arguments accept an unquoted column name, a quoted string, or a one-sided formula.

Guards

Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
  • The assumed support of the outcome must cover the observed outcomes, alpha and delta must lie in their ranges, and every treatment group needs at least one respondent, one follow-up attempt and one follow-up respondent (within every stratum, when strata are supplied). Each of these is an error naming the problem rather than a NaN or a bound that is not a bound.
  • A monotonicity violation in the direction assumed returns NA bounds with a warning naming the direction the response rates do admit. A zero trimming proportion warns that Lee's interior-point condition fails. Missingness rates summing to one or more, or a trimming proportion that leaves one side of a group empty, are errors, and the bootstrap drops the replicates in which they occur and reports how many survived.

Data

  • levendusky_replication: the replication study reported in the paper, a two-wave survey experiment in which 536 of 1,980 subjects did not answer the second wave and 100 of them were followed up at a higher incentive. The tibble holds the polarized-versus-moderate contrast the paper analyzes, with columns named for the roles they play. data-raw/levendusky_replication.R rebuilds it from the Harvard Dataverse deposit.
  • vignette("attrition") works through the design and all five estimators on those data, reproduces Table 3 of the paper, draws the imputation the worst-case bounds average over, and closes with every estimator on one axis, grouped by the population each one describes.

Changes from the development version on GitHub

For anyone who installed the pre-release package from GitHub:

  • Output names changed. The bounding estimators returned low_est, upp_est, low_var, upp_var, ci_lower and ci_upper, and estimator_trim() returned lower_bound, upper_bound, lower_se and upper_se. The third pair of the old names held variances; the new std.error_lower and std.error_upper are standard errors.
  • The dataset was levendusky and held all three experimental conditions with the archive's column names. It is now levendusky_replication, the analyzed contrast alone.
  • sensitivity_ds() returns delta_star, a single number or NA, in place of p_star, and its sims_df has a delta column in place of p.
  • The Imbens-Manski critical value was found by a bounded optimizer whose search interval only covered alpha near 0.05, so confidence intervals at other levels were wrong: at alpha = 0.01 it returned 2.000 against a correct 2.326. The root is now found with uniroot() on a bracket derived from alpha. Bound estimates and variances are unaffected.
  • estimator_trim() with R1, Attempt and R2 previously trimmed both groups without a way to assume monotonicity, and with R assumed monotonicity in one fixed direction. Both defaults are unchanged, and the monotonicity argument now reaches the other combinations.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.6 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OKNow
  • OK7 OK2026-09-19
Advisories

none known

Documentation

In release 1.0.0
READMEYes · 880 wordsVignettesYes · 1 · dynamicNEWSYes · 67% structured · mentions 1.0.0Citation fileNoWebsiteYes · pkgdown
Help pages
16 (2 internal)includes a package overview page
Examples that run
100%8 run in a plain check
Exported functions with examples
83%
Documented parameters
98%
Return-value docs
83%
Help pages citing references
44%

Downloads

563
CRAN downloads in the past year
Rank #22,948 · ~2/day · ~47/mo
Daily download trend is not available in this view yet.
55030 days
56390 days
5631 year
Compare downloads with other packages →
Also on7 r2u34 autocran

Repository

8Stars
2Forks
0Open issues
0Open PRs
0Releases
59Commits
1Commit identities
59 commits · Last activity 2026-09-21
Responsiveness
not measured

Commits over time

2026-09-20 · 582026-09-27 · 59
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/acoppock/attrition on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-21 · The repository has a site deploy workflow

pkgdown site last built 2026-09-21

Coverage (1)
Coverage reporting
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-03-18
    Named in .Rbuildignore: .claude
    Named in .gitignore: .claude
    Commits: at least 39 crediting it in the message
Models named in its commits
  • Claude Opus 531 commits · Aug to Sep 2026
  • Claude Fable 5.16 commits · Sep 2026
  • Claude Sonnet 4.62 commits · Mar 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)

Installing attrition adds 23 packages (10 with compiled code, 15 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (4)
Author, Maintainer since 1.0.0 (2026)
Releases (1)
  • 1.0.0Latest
    2026-09-18 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-09-18
Total releases
1 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 4.1.0
Bundled data
7.6 KB / 1 file
Download size
287 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("attrition")
Coppock, A., Gerber, A. S., Green, D. P., & Kern, H. L. (2026). attrition: Addressing Nonignorable Attrition with Double Sampling and Bounds (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.attrition

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for attrition version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy