Skip to content

Commit e4b3f10

Browse files
igerberclaude
andcommitted
Add global-path weighted ATT regression test for TROP survey
Addresses CI review P3: the global method's survey weight path (separate from local) was only smoke-tested. This test verifies non-uniform survey weights actually change the ATT for method="global". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1475c40 commit e4b3f10

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/test_survey_phase5.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,26 @@ def test_weighted_att_differs(self, trop_survey_data, survey_design_weights):
528528
)
529529
assert result_survey.att != pytest.approx(result_no.att, abs=1e-6)
530530

531+
def test_weighted_att_differs_global(self, trop_survey_data, survey_design_weights):
532+
"""Non-uniform weights change ATT for method='global'."""
533+
est = TROP(method="global", n_bootstrap=10, seed=42, max_iter=5)
534+
result_no = est.fit(
535+
trop_survey_data,
536+
outcome="outcome",
537+
treatment="D",
538+
unit="unit",
539+
time="time",
540+
)
541+
result_survey = est.fit(
542+
trop_survey_data,
543+
outcome="outcome",
544+
treatment="D",
545+
unit="unit",
546+
time="time",
547+
survey_design=survey_design_weights,
548+
)
549+
assert result_survey.att != pytest.approx(result_no.att, abs=1e-6)
550+
531551
def test_summary_includes_survey(self, trop_survey_data, survey_design_weights):
532552
"""summary() contains survey section."""
533553
est = TROP(method="local", n_bootstrap=10, seed=42, max_iter=5)

0 commit comments

Comments
 (0)