Skip to content

Commit 82043ca

Browse files
committed
fix(diagnose): correct worked-example arithmetic (round-2 convergence)
Round-2 adversarial audit caught a real arithmetic contradiction in the worked example: '3 duplicate rows per id' implies ~4x inflation (12,400 -> ~49,600), but the example showed 12,400 -> 12,933. Reframed to 'duplicate covars rows for a subset of ids -> +533 rows', which is internally consistent and matches the displayed merge output. 'many-to-many merge' kept (correct for a panel: many periods per id x duplicated covars per id). Round 2 is now dry.
1 parent 6ce2621 commit 82043ca

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.claude/skills/diagnose/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ A staggered-DiD `ATT` jumped from `−0.043` to `−0.071` after a data refresh;
127127
nrow(panel) # 12,400 (expected)
128128
nrow(merge(panel, covars, by="id")) # 12,933 <-- inflated! a many-to-many merge
129129

130-
# Root cause: covars has 3 duplicate rows per id after the refresh; the join
131-
# fans 12,400 -> 12,933, re-weighting the ATT toward the duplicated units.
130+
# Root cause: the refresh left duplicate covars rows for a subset of ids; the
131+
# join fans those ids out, 12,400 -> 12,933 (+533 rows), re-weighting the ATT
132+
# toward the duplicated units.
132133

133134
# Phase 5 — minimal fix at the root (dedup the key), NOT a downstream row filter:
134135
covars <- covars[!duplicated(covars$id), ]

0 commit comments

Comments
 (0)