Estimate lee bounds under attrition
Partially identify a randomized treatment effect under differential outcome attrition using direction-aware fractional Lee trimming and bootstrap outer bounds.
What it's for
Keeps intervention claims honest when one randomized arm yields more observed outcomes, without pretending missingness is ignorable.
What you give it
Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.
| Field | Type | Role | Required |
|---|---|---|---|
| bootstrap_draws | integer ≥ 200, ≤ 20000 | Numerical control | Optional |
| confidence_level | number ≥ 0.8, ≤ 0.999 | Your calibration | Optional |
| minimum_practical_effect | number ≥ 0 | Your calibration | Optional |
| monotone_selection_direction | one of "treatment_weakly_increases_selection", "treatment_weakly_decreases_selection" | Your calibration | Optional |
| observations | array of objects (4 fields) | Evidence | Yes |
| seed | integer | Numerical control | Optional |
Each observations
record
| Field | Type | Required |
|---|---|---|
| id | string (non-empty) | Yes |
| outcome | number | Optional |
| selected | boolean | Yes |
| treatment | one of "0", "1" | Yes |
{
"bootstrap_draws": 200,
"minimum_practical_effect": 1,
"observations": [
{
"id": "control-0",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-1",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-2",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-3",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-4",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-5",
"outcome": 0,
"selected": true,
"treatment": 0
},
{
"id": "control-6",
"outcome": 0,
"selected": true, Truncated for display — the full payload is 907 lines.
What you get back
This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.
{
"assumptions": [
"Treatment is randomized, assignment precedes selection, and stable-unit treatment value plus consistency hold for the target outcome.",
"Selection is monotone at unit level in the declared direction; treatment never moves selection in the opposite direction for any unit.",
"Lee trimming identifies a bounded effect for always-selected units, not the full randomized population and not an individual-level effect.",
"Bootstrap uncertainty is conditional on the design and declared monotonicity; severe selection-order instability should trigger more data rather than a causal claim."
],
"decision": "effect_robustly_positive_under_attrition",
"effect_bounds": {
"lower": 2,
"minimum_practical_effect": 1,
"naive_selected_outcome_difference": 4.6667,
"uncertainty_outer_interval": {
"high": 8.3541,
"low": 2
},
"upper": 6,
"width": 4
},
"method": "randomized_lee_monotone_selection_bounds_v1",
"sample": {
"bootstrap_attempts": 201,
"bootstrap_draws": 200,
"confidence_level": 0.95,
"control_rows": 80,
"control_selected": 40,
"monotonicity_consistency_fraction": 0.995,
"rows": 160,
"treated_rows": 80,
"treated_selected": 60
},
"selection": {
"control_rate": 0.5,
"monotone_direction": "treatment_weakly_increases_selection",
"rate_difference": 0.25,
"treated_rate": 0.75,
"trim_fraction_in_higher_selection_arm": 0.3333
}
} How it works
Causal inference & experiment design — Separate what a change caused from what merely moved alongside it.
- 1 Partially identify a randomized treatment effect under differential outcome attrition using direction-aware fractional Lee trimming and bootstrap outer bounds.
- 2 Evaluate the method-specific diagnostics and gates returned by the function, then abstain unless the declared decision clears them under locally governed thresholds.
Before you trust it
Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.
Assumptions & guardrails
- Assignment or adoption timing, interference policy, overlap, attrition, and outcome availability match the estimand encoded by the method.
- A causal label is warranted only when design and diagnostic requirements pass; otherwise treat the result as descriptive or abstain.
Minimum evidence
- observations: required and organization-defined
How to validate it
Preserve the assignment/adoption design and validate overlap, pre-period or placebo diagnostics, attrition, interference policy, and cluster-level uncertainty; never tune on the estimated effect.
Calibrating it to your org
Same for everyone
The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.
Specific to you
- binary selection indicator
- analysis outcome
- randomized treatment assignment
- monotone selection direction
- minimum practical effect
Calibration workflow
- 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
- 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
- 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
- 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
- 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
- 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.
Call it from your AI
You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.
gitrevio_capabilities_search
{ "q": "partially identify a randomized treatment effect" }
→ finds "estimate_lee_bounds_under_attrition"
gitrevio_capability_describe
{ "capability_id": "estimate_lee_bounds_under_attrition" }
→ returns the input schema and agent guidance shown on this page
gitrevio_capability_run
{ "capability_id": "estimate_lee_bounds_under_attrition", "arguments": { ... } }
→ returns the result shown above Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.
Related tools
Audit causal claim negative controls
Gate a causal effect claim using prespecified negative outcome/exposure controls, Benjamini-Hochberg multiplicity control, and an omnibus chi-square falsification test.
Audit cluster randomization integrity
Audit cluster-randomized experiments for practical baseline imbalance and differential outcome observation, with cluster-size-weighted standardized differences and assignment permutation diagnostics.
Audit growth incrementality experiment integrity
Audit aggregate randomized growth experiments before anyone trusts channel incrementality: enforce unique experimental units, nondegenerate logged propensities, both arms, control-spend discipline, baseline balance, spillover and evidence gates; then estimate propensity-weighted baseline-adjusted contribution, cluster-unit bootstrap uncertainty and incremental return on spend.
Audit joint outcome network integrity
Audit whether a company-specific Bayesian joint-outcome network is fit for reliance by validating point-in-time lineage, DAG and CPT completeness, effective support, protected-attribute exclusions, and strictly out-of-time outcome calibration against a baseline.
Audit staggered rollout identification
Audit staggered team-by-team adoption with not-yet-treated controls and require every simultaneous pre-period interval to fit inside a governed equivalence margin.
Design balanced stepped wedge rollout
Assign teams or other aggregate clusters to capacity-constrained rollout waves with pair-exchange optimization of cumulative causal balance, represented population, and rollout risk.