Skip to content

Comments

Fix _parse_formula to support covariates before interaction term #186

Open
SermetPekin wants to merge 1 commit intoigerber:mainfrom
SermetPekin:fix/parse-formula
Open

Fix _parse_formula to support covariates before interaction term #186
SermetPekin wants to merge 1 commit intoigerber:mainfrom
SermetPekin:fix/parse-formula

Conversation

@SermetPekin
Copy link

Methodology references (required if estimator / math changes)

Method name(s): N/A — no estimator logic or math changed. This fixes a formula string parser, not the underlying estimation.
Paper / source link(s): N/A
Any intentional deviations from the source (and why): N/A
Validation

Tests added/updated: Added test_parse_formula.py with 6 tests covering:
Covariates before * (e.g. y ~ x1 + treated * post) — was broken, now fixed
Covariates on both sides of * (e.g. y ~ x1 + treated * post + x2) — was broken, now fixed
Multiple ~ gives clear error
Extra/no whitespace handling
Formula-vs-explicit-params equivalence (ATT and SE match to rtol=1e-10)
All 9 existing formula tests in test_methodology_did.py and test_estimators.py pass unchanged (no regressions)
Backtest / simulation / notebook evidence (if applicable): N/A
Security / privacy

Confirm no secrets/PII in this PR: Confirmed — changes are limited to formula parsing logic and test data generated with np.random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant