SPB Git

spb/wp29_uqo

Public
2.2 KB · 34 lines markdown
1# F2-smoke-01 — Slope estimate with firm-clustered uncertainty23## Question4Estimate the population slope β in the linear projection y = α + βx + ε for a synthetic firm panel. The standard error must allow for errors that are correlated within a firm and independent across firms.56## Data and exclusions7- Input: `data/panel.csv` (synthetic). 2000 rows read; 50 firms, each with exactly 40 observations.8- Checks: no missing values, no non-finite values, no exact duplicate rows. Nothing was excluded, so all 2000 observations were analysed. `data_issues` is empty.910## Method11- Pooled OLS of y on x with an intercept (statsmodels).12- Naïve baseline: conventional homoskedastic OLS standard error.13- Main inference: cluster-robust (Liang–Zeger / CR1) variance clustered by `firm_id`, using the standard small-sample correction G/(G−1)·(N−1)/(N−K).14- 95% CI: β̂ ± t(0.975, G−1)·SE_cluster with G−1 = 49 degrees of freedom (t = 2.0096). This is a common conservative choice when there are few clusters.15- The procedure is deterministic, so no random seed is needed. `out/analysis.py` regenerates `out/results.json`.1617## Results18| quantity | value |19|---|---|20| β̂ (slope) | 0.8051 |21| α̂ (intercept) | 1.4440 |22| SE, OLS (naïve) | 0.0241 |23| SE, clustered by firm | 0.0731 |24| 95% CI (clustered) | [0.6581, 0.9521] |25| N / clusters | 2000 / 50 |2627## Uncertainty28The firm-clustered SE is about 3.03 times the naïve OLS SE. This means x and the residuals are both strongly correlated within firms. The naïve SE therefore greatly overstates precision: its implied interval would be roughly a third as wide. Even with the clustered SE, the interval excludes 0 by a wide margin.2930## Limitations and open issues31- With 50 equal-sized clusters, CR1 with t(G−1) critical values should be reasonably reliable. Still, cluster-robust inference is asymptotic in G. A wild cluster bootstrap was not run.32- β is a linear-projection (association) coefficient, not a causal effect. Pooled OLS mixes within-firm and between-firm variation in x. A firm fixed-effects slope could differ but was not the estimand asked for.33- The data are synthetic, so the conclusions describe only this dataset.34
Files · 76de75e34e7d7535b63ac807cf0f9207c542f4a1
Menu

Theme