SPB Git

spb/wp29_uqo

Public

# F2-smoke-01 — Slope estimate with firm-clustered uncertainty

# Question

Estimate the population slope β of the linear projection y = α + βx + ε in a synthetic firm panel, with standard errors that allow arbitrary correlation among observations of the same firm (independence across firms).

# Data and exclusions

data/panel.csv (SHA-256 968410b9…ce5a8) has 2000 rows (n_input_rows) and 3 columns; there are no missing values and no duplicate rows. The panel is balanced, with 50 firms (n_clusters) of 40 rows each (obs_per_cluster_min, obs_per_cluster_max). I applied no exclusions (see out/exclusions.csv, where every step removed 0 rows), so 2000 observations were analysed (n_analysed). No data problems were found (data_issues is empty).

# Method

I ran OLS of y on x with an intercept. The conventional homoskedastic standard error is the naïve baseline (se_ols). The main standard error is cluster-robust by firm_id (se_cluster). It uses the sandwich (X'X)⁻¹ [Σ_g X_g'e_g e_g'X_g] (X'X)⁻¹ with the CR1 small-sample factor G/(G−1)·(N−1)/(N−K) (cluster_se_correction). The 95% CI is beta_hat ± t₀.₉₇₅,G−1 · se_cluster, with G−1 = 49 df (ci_critical_value_t_df, ci_critical_value). The method involves no randomness (random_seed = null). Estimates match statsmodels exactly (see out/state/checks.md).

# Results

  • Slope: beta_hat = 0.8051 (beta_hat). Intercept: alpha_hat = 1.4440 (alpha_hat).
  • Firm-clustered SE = 0.0731 (se_cluster). Conventional OLS SE = 0.0241 (se_ols).
  • 95% CI for β using the clustered SE: [0.6581, 0.9521] (beta_ci_low, beta_ci_high). The CI excludes 0.

# Uncertainty

The clustered SE is about 3.03 times the naïve SE (se_ratio_cluster_to_ols). This fits the strong within-firm dependence found in the audit (out/state/data_audit.md, not a results key): firm means account for about 45% of the variance of x and about 53% of the variance of the OLS residuals. Treating the 2000 observations as independent would therefore greatly overstate precision. With 50 balanced clusters, cluster-robust inference based on t(49) is standard and should be reasonably reliable.

# Limitations and open issues

  • β is a linear-projection (association) coefficient, not a causal effect. Because x is correlated within firms, β pools within-firm and between-firm variation, and I did not estimate firm fixed effects (the task did not ask for them).
  • Cluster-robust inference is asymptotic in the number of clusters. 50 clusters is adequate, but the CI is approximate. I did not run a wild cluster bootstrap.
  • The data are synthetic, as stated in TASK.md.
Files · main
Menu

Theme