# F2-smoke-01 — Slope estimate with firm-clustered uncertainty ## Scientific question Estimate the linear association between an outcome `y` and a regressor `x` in a panel of firms, with valid uncertainty. The estimand is the population slope β in the linear projection y = α + βx + ε, and its sampling uncertainty must account for the fact that observations from the same firm share a common firm-level shock (observations are independent across firms, not within firms). ## Inputs - `data/panel.csv` — simulated data (this is a synthetic dataset generated for this exercise; it is not observed data). Columns: `firm_id` (integer firm identifier), `x` (regressor, dimensionless), `y` (outcome, dimensionless). One row per firm–observation pair; rows are in random order. ## Information-availability rules - Use only `data/panel.csv`. No other input exists. ## Required outputs - `out/results.json` with the keys: | key | type | meaning | |---|---|---| | `task_id` | string | "F2-smoke-01" | | `beta_hat` | number | OLS slope estimate of y on x (with intercept) | | `alpha_hat` | number | OLS intercept | | `se_ols` | number | conventional (homoskedastic, non-clustered) OLS standard error of the slope — the naïve baseline | | `se_cluster` | number | standard error of the slope clustered by `firm_id` | | `beta_ci_low`, `beta_ci_high` | number | 95% confidence interval for β using the clustered standard error | | `n_analysed` | integer | observations used | | `n_clusters` | integer | number of firms | | `feasibility` | string | "complete", "partial" or "infeasible" | | `feasibility_reason` | string or null | explanation if not complete | | `data_issues` | array of {"issue","handling"} | data problems detected and how handled (empty list if none) | | `n_input_rows` | object | {"panel.csv": rows read} | | `random_seed` | integer or null | seed used, if any | - `out/report.md` with the sections: Question; Data and exclusions; Method; Results; Uncertainty; Limitations and open issues. - `out/analysis.py` — running `~/wp29/venv/bin/python out/analysis.py` from the workspace root must regenerate `out/results.json` from `data/` only, deterministically. - `out/claims.json` — a list of the central claims of the report: [{"id": "C1", "text": "...", "results_keys": ["..."], "status": "supported"|"unsupported"|"not_evaluated", "caveat": "..."}]. ## Constraints - No network access. Python: `~/wp29/venv/bin/python` (numpy, pandas, scipy, statsmodels available). Do not modify `data/`. - This task is designed to be completed in well under 15 minutes of work.