FAILURE MAP
← Case archive

FA-12671 / Causal analysis data contracts / Open access

A synthetic Wald ratio divides by uptake level instead of uptake contrast · case 01

A synthetic Wald ratio divides by uptake level instead of uptake contrast.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The instrument first stage is not differenced between instrument arms.

VERIFIED REPAIR

Divide the reduced-form outcome contrast by the signed uptake contrast.

Unsuccessful approach: Taking the absolute first stage reverses effects when instrument coding is reversed.

Case contract

Input [meanY0,meanY1,meanD0,meanD1] describes a supplied synthetic IV design; return its Wald ratio, None when first stage is zero. No identification assumptions are inferred.

Why this case matters

A deterministic synthetic study model isolates this data-contract defect; outputs alone establish no real-world causal identification.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(means):
    y0,y1,d0,d1 = means
    return (y1-y0)/d1 if d1 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nonzero baseline', solve([0,N,0.25,0.75]), 2*N)
check('reversed instrument', solve([N,0,0.75,0.25]), 2*N)
check('no first stage', solve([0,N,0.5,0.5]), None)
check('zero uptake', solve([0,N,0,0]), None)
check('null reduced form', solve([N,N,0,1]), 0)
check('negative ratio', solve([N,0,0,1]), -N)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
nonzero baseline1.33333333333333332Failed
reversed instrument-4.02Failed
no first stage2.0NoneFailed
zero uptakeNoneNonePassed
null reduced form0.00Passed
negative ratio-1.0-1Passed

SHA-256 / dfc9df0d4b0a30268089d0790c3acedc051509f0e9a4f14c22d5fb8cf5cedc6d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(means):
    y0,y1,d0,d1 = means
    return (y1-y0)/abs(d1-d0) if d1 != d0 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nonzero baseline', solve([0,N,0.25,0.75]), 2*N)
check('reversed instrument', solve([N,0,0.75,0.25]), 2*N)
check('no first stage', solve([0,N,0.5,0.5]), None)
check('zero uptake', solve([0,N,0,0]), None)
check('null reduced form', solve([N,N,0,1]), 0)
check('negative ratio', solve([N,0,0,1]), -N)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
nonzero baseline2.02Passed
reversed instrument-2.02Failed
no first stageNoneNonePassed
zero uptakeNoneNonePassed
null reduced form0.00Passed
negative ratio-1.0-1Passed

SHA-256 / 166e66da60173a60fcb93b5ca70672fed15187b5a7a8cfa7607bf283138de189

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(means):
    y0,y1,d0,d1 = means
    return (y1-y0)/(d1-d0) if d1 != d0 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nonzero baseline', solve([0,N,0.25,0.75]), 2*N)
check('reversed instrument', solve([N,0,0.75,0.25]), 2*N)
check('no first stage', solve([0,N,0.5,0.5]), None)
check('zero uptake', solve([0,N,0,0]), None)
check('null reduced form', solve([N,N,0,1]), 0)
check('negative ratio', solve([N,0,0,1]), -N)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
nonzero baseline2.02Passed
reversed instrument2.02Passed
no first stageNoneNonePassed
zero uptakeNoneNonePassed
null reduced form0.00Passed
negative ratio-1.0-1Passed

SHA-256 / 3d20233b9179f2499c3d22c07dc661cb7a7a1c6bd0272bdb0fcbfc9520050273

Verification & scope

Finite, fully specified synthetic data only; identification assumptions are supplied by the fixture design, not inferred from observations. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:59.052990+00:00.

Case digest / 66f60786235a163454c79ab429e5c1eb635462363dd14d9875e5fa20a01ca92b