1# F2-dev-01 — Two-way fixed-effects slope in a firm–year panel with firm-clustered uncertainty23## Scientific question4Estimate the within-firm, within-year association between an outcome `y` and a regressor `x` in a balanced panel of firms observed over several years. The estimand is the slope β in the two-way fixed-effects model y_it = a_i + g_t + β x_it + u_it, where a_i is a firm effect and g_t is a year effect (both unrestricted, possibly correlated with x). Its sampling uncertainty must allow for arbitrary dependence of the disturbances within a firm over time (observations are independent across firms, not within firms).56## Inputs7- `data/firm_panel.csv` — simulated data (a synthetic dataset generated for this exercise; it is not observed data). Columns: `firm_id` (integer firm identifier), `year` (integer calendar year), `x` (regressor, dimensionless), `y` (outcome, dimensionless). One row per firm–year; rows are in random order.89## Information-availability rules10- Use only `data/firm_panel.csv`. No other input exists.1112## Required outputs13- `out/results.json` with the keys:1415| key | type | unit | meaning |16|---|---|---|---|17| `task_id` | string | – | "F2-dev-01" |18| `beta_pooled` | number | – | pooled OLS slope of y on x with an intercept and no fixed effects — the naïve baseline |19| `beta_fe` | number | – | two-way fixed-effects (firm + year) estimate of β |20| `se_conventional` | number | – | conventional (homoskedastic, independent errors) standard error of `beta_fe` |21| `se_cluster` | number | – | standard error of `beta_fe` clustered by `firm_id` |22| `beta_ci_low`, `beta_ci_high` | number | – | 95% confidence interval for β built from `se_cluster` |23| `n_firms` | integer | – | number of distinct firms used |24| `n_years` | integer | – | number of distinct years used |25| `n_analysed` | integer | – | firm–year observations used in the fixed-effects estimate |26| `feasibility` | string | – | "complete", "partial" or "infeasible" |27| `feasibility_reason` | string or null | – | explanation if not complete |28| `data_issues` | array of {"issue","handling"} | – | data problems detected and how handled (empty list if none) |29| `n_input_rows` | object | – | {"firm_panel.csv": rows read} |30| `random_seed` | integer or null | – | seed used, if any |3132- `out/report.md` with the sections: Question; Data and exclusions; Method; Results; Uncertainty; Limitations and open issues.33- `out/analysis.py` — running `~/wp29/venv/bin/python out/analysis.py` from the workspace root must regenerate `out/results.json` from `data/` only, deterministically.34- `out/claims.json` — a list of the central claims of the report: [{"id": "C1", "text": "...", "results_keys": ["..."], "status": "supported"|"unsupported"|"not_evaluated", "caveat": "..."}].3536## Constraints37- No network access. Python: `~/wp29/venv/bin/python` (numpy, pandas, scipy, statsmodels available). Do not modify `data/`.38- This task is designed to be completed in well under 15 minutes of work.39