Econometrics Check
Run a 4-phase causal inference audit on the target file(s) for the sewage-house-prices project.
Input: $ARGUMENTS — a .tex file, .R script, directory path, or all.
Project-Specific Context
Identification Strategies in This Paper
- Hedonic regressions — Cross-sectional:
log(price) on spill count/hours (continuous + bins), LSOA FE, heteroskedasticity-robust SE
- Repeat sales — Within-property variation (Palmquist 1982), house fixed effects
- Long difference — 250m grid-level changes, weighted/unweighted, all/exposed grids
- News/media DiD — Google Trends and LexisNexis media coverage as treatment
- Upstream/downstream — Directional spillover via PostGIS river network topology
- Dry spills — Spills occurring without rainfall as identification variation (rainfall threshold-based)
Key Variables
- Outcome:
log(price) for sales, log(rent) for rentals
- Treatment:
spill_count, spill_hrs, spill_count_daily_avg, spill_hrs_daily_avg
- Geography:
n_spill_sites within radius, min_dist / mean_dist
- Radii: 250m, 500m, 1000m, 2000m, 5000m, 10000m
- Fixed effects: LSOA (
lsoa), MSOA (msoa), year-quarter
- SE: heteroskedasticity-robust via
fixest::feols(vcov = "hetero")
- Counting: 12/24-hour methodology in
spill_aggregation_utils.R
File Locations
- Manuscript:
docs/overleaf/*.tex
- Analysis scripts:
scripts/R/09_analysis/
- Utility functions:
scripts/R/utils/
- Pipeline scripts:
scripts/R/01_data_ingestion/ through scripts/R/06_analysis_datasets/
Workflow
Step 1: Parse Input
Determine target from $ARGUMENTS:
.tex file: Review manuscript section for identification claims, assumption statements, estimation descriptions
.R file: Review analysis script for code-theory alignment, package usage, SE computation
- Directory (e.g.
scripts/R/09_analysis/02_hedonic/): Review all scripts in that approach
all: Review docs/overleaf/*.tex and scripts/R/09_analysis/
- No argument: Review all manuscript sections and analysis scripts
Step 2: Context Gathering
Before auditing:
- Read the target file(s)
- Read
docs/overleaf/refs.bib for citation availability
- If reviewing scripts: read corresponding manuscript section for code-theory alignment
- If reviewing manuscript: read corresponding analysis scripts for accuracy
- Read
scripts/R/utils/spill_aggregation_utils.R for counting methodology
Step 3: Run 4-Phase Review
Phase 1: Claim Identification
- What design is being used? (hedonic / repeat sales / long diff / DiD / upstream-downstream / dry spill)
- What is the estimand? (ATT / ATE / LATE)
- What is the treatment? (spill count, spill hours, distance, media coverage)
- What is the comparison group?
Phase 2: Core Design Validity
Design-specific assumption checks:
Hedonic:
- Selection on observables assumption — are LSOA FE sufficient?
- Omitted variable bias from neighbourhood sorting
- Measurement error in spill count/hours
Repeat sales:
- Within-property variation correctly specified
- Time-varying confounders addressed
- Property-level fixed effects properly implemented
Long difference:
- Grid construction and assignment correct
- Weighted vs unweighted justified
- Pre-period balance
DiD / Event studies:
- Parallel trends assumption stated and tested
- Treatment timing correctly identified
- Staggered adoption issues addressed (if applicable)
Upstream/downstream:
- River network topology correctly implemented
- Directionality assumption valid
- Spillover definitions consistent
Dry spills:
- Rainfall threshold justified
- Dry vs wet spill definition consistent with data pipeline
- Selection into dry spills addressed
Phase 3: Inference
- SE computation: heteroskedasticity-robust applied correctly
- Multiple testing: across radii, specifications, outcomes
- Code-theory alignment: does the R code implement what the paper claims?
Phase 4: Polish & Completeness
- Robustness checks: radius sensitivity, time period variation, specification changes
- Sensitivity analysis: how sensitive are results to key assumptions?
- Citation fidelity: are methodological references accurate?
Early stopping: If Phase 2 finds CRITICAL issues, focus there.
Step 4: Present Summary
## Econometrics Audit: [target]
**Date:** YYYY-MM-DD
### Design(s) Reviewed
- [List designs audited]
### Overall Assessment: [SOUND / MINOR ISSUES / MAJOR ISSUES / CRITICAL ERRORS]
### Blocking Issues (CRITICAL)
1. ...
### Priority Action List
1. ...
2. ...
3. ...
### Positive Findings
- ...
Save report to output/log/econometrics_check_[target].md.
Principles
- Design-opinionated, package-flexible. Validate the econometric logic, not just the R packages.
- Cross-reference code and paper. Flag any mismatch between what the manuscript says and what the script does.
- Actionable output. Every issue must have a concrete fix.
- Proportional. Not every approach needs every robustness check.
- Sequential phases. Never skip to robustness before verifying the core design holds.
1---2name: econometrics-check3description: Causal inference design audit for the sewage-house-prices project. Runs a 4-phase review (claim identification, design validity, inference, polish) covering hedonic pricing, repeat sales, long difference, DiD/event studies, upstream/downstream, and dry spill strategies. This skill should be used when asked to "check the econometrics", "audit the identification", "review the strategy", or when verifying that code matches the stated design.4argument-hint: "[.tex section, .R script, directory path, or 'all']"5allowed-tools: ["Read", "Grep", "Glob", "Write", "Agent"]6metadata:7 source: https://skillmd.com/skills/brycewang-stanford/econometrics-check8---910# Econometrics Check1112Run a 4-phase causal inference audit on the target file(s) for the sewage-house-prices project.1314**Input:** `$ARGUMENTS` — a `.tex` file, `.R` script, directory path, or `all`.1516---1718## Project-Specific Context1920### Identification Strategies in This Paper21221. **Hedonic regressions** — Cross-sectional: `log(price)` on spill count/hours (continuous + bins), LSOA FE, heteroskedasticity-robust SE232. **Repeat sales** — Within-property variation (Palmquist 1982), house fixed effects243. **Long difference** — 250m grid-level changes, weighted/unweighted, all/exposed grids254. **News/media DiD** — Google Trends and LexisNexis media coverage as treatment265. **Upstream/downstream** — Directional spillover via PostGIS river network topology276. **Dry spills** — Spills occurring without rainfall as identification variation (rainfall threshold-based)2829### Key Variables3031- Outcome: `log(price)` for sales, `log(rent)` for rentals32- Treatment: `spill_count`, `spill_hrs`, `spill_count_daily_avg`, `spill_hrs_daily_avg`33- Geography: `n_spill_sites` within radius, `min_dist` / `mean_dist`34- Radii: 250m, 500m, 1000m, 2000m, 5000m, 10000m35- Fixed effects: LSOA (`lsoa`), MSOA (`msoa`), year-quarter36- SE: heteroskedasticity-robust via `fixest::feols(vcov = "hetero")`37- Counting: 12/24-hour methodology in `spill_aggregation_utils.R`3839### File Locations4041- Manuscript: `docs/overleaf/*.tex`42- Analysis scripts: `scripts/R/09_analysis/`43- Utility functions: `scripts/R/utils/`44- Pipeline scripts: `scripts/R/01_data_ingestion/` through `scripts/R/06_analysis_datasets/`4546---4748## Workflow4950### Step 1: Parse Input5152Determine target from `$ARGUMENTS`:53- **`.tex` file:** Review manuscript section for identification claims, assumption statements, estimation descriptions54- **`.R` file:** Review analysis script for code-theory alignment, package usage, SE computation55- **Directory (e.g. `scripts/R/09_analysis/02_hedonic/`):** Review all scripts in that approach56- **`all`:** Review `docs/overleaf/*.tex` and `scripts/R/09_analysis/`57- **No argument:** Review all manuscript sections and analysis scripts5859### Step 2: Context Gathering6061Before auditing:621. Read the target file(s)632. Read `docs/overleaf/refs.bib` for citation availability643. If reviewing scripts: read corresponding manuscript section for code-theory alignment654. If reviewing manuscript: read corresponding analysis scripts for accuracy665. Read `scripts/R/utils/spill_aggregation_utils.R` for counting methodology6768### Step 3: Run 4-Phase Review6970#### Phase 1: Claim Identification71- What design is being used? (hedonic / repeat sales / long diff / DiD / upstream-downstream / dry spill)72- What is the estimand? (ATT / ATE / LATE)73- What is the treatment? (spill count, spill hours, distance, media coverage)74- What is the comparison group?7576#### Phase 2: Core Design Validity77Design-specific assumption checks:7879**Hedonic:**80- Selection on observables assumption — are LSOA FE sufficient?81- Omitted variable bias from neighbourhood sorting82- Measurement error in spill count/hours8384**Repeat sales:**85- Within-property variation correctly specified86- Time-varying confounders addressed87- Property-level fixed effects properly implemented8889**Long difference:**90- Grid construction and assignment correct91- Weighted vs unweighted justified92- Pre-period balance9394**DiD / Event studies:**95- Parallel trends assumption stated and tested96- Treatment timing correctly identified97- Staggered adoption issues addressed (if applicable)9899**Upstream/downstream:**100- River network topology correctly implemented101- Directionality assumption valid102- Spillover definitions consistent103104**Dry spills:**105- Rainfall threshold justified106- Dry vs wet spill definition consistent with data pipeline107- Selection into dry spills addressed108109#### Phase 3: Inference110- SE computation: heteroskedasticity-robust applied correctly111- Multiple testing: across radii, specifications, outcomes112- Code-theory alignment: does the R code implement what the paper claims?113114#### Phase 4: Polish & Completeness115- Robustness checks: radius sensitivity, time period variation, specification changes116- Sensitivity analysis: how sensitive are results to key assumptions?117- Citation fidelity: are methodological references accurate?118119**Early stopping:** If Phase 2 finds CRITICAL issues, focus there.120121### Step 4: Present Summary122123```markdown124## Econometrics Audit: [target]125**Date:** YYYY-MM-DD126127### Design(s) Reviewed128- [List designs audited]129130### Overall Assessment: [SOUND / MINOR ISSUES / MAJOR ISSUES / CRITICAL ERRORS]131132### Blocking Issues (CRITICAL)1331. ...134135### Priority Action List1361. ...1372. ...1383. ...139140### Positive Findings141- ...142```143144Save report to `output/log/econometrics_check_[target].md`.145146---147148## Principles149150- **Design-opinionated, package-flexible.** Validate the econometric logic, not just the R packages.151- **Cross-reference code and paper.** Flag any mismatch between what the manuscript says and what the script does.152- **Actionable output.** Every issue must have a concrete fix.153- **Proportional.** Not every approach needs every robustness check.154- **Sequential phases.** Never skip to robustness before verifying the core design holds.