npx claudepluginhub brainbytes-dev/everything-claude-financeThis skill uses the workspace's default tool permissions.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Integrates PayPal payments with express checkout, subscriptions, refunds, and IPN. Includes JS SDK for frontend buttons and Python REST API for backend capture.
name: econometrics description: Econometric methods — regression, panel data, IV. Cover OLS, panel (FE/RE), instrumental variables, VAR.
Model:
Y = beta_0 + beta_1 * X_1 + beta_2 * X_2 + ... + beta_k * X_k + epsilon
OLS minimizes: Sum of squared residuals = Sum(Y_i - Y_hat_i)^2
Gauss-Markov assumptions (for OLS to be BLUE — Best Linear Unbiased Estimator):
Additional for valid inference: 6. Normality of errors: epsilon ~ N(0, sigma^2) — needed for exact t and F tests in small samples (not needed asymptotically)
Key diagnostics:
| Issue | Detection | Consequence | Solution |
|---|---|---|---|
| Heteroskedasticity | Breusch-Pagan, White test | Inefficient estimates, biased SEs | Robust (White) SEs, WLS |
| Autocorrelation | Durbin-Watson, Breusch-Godfrey | Inefficient, biased SEs | Newey-West SEs, GLS, add lags |
| Multicollinearity | VIF > 10, condition number | Inflated SEs, unstable coefficients | Drop variable, PCA, ridge |
| Endogeneity | Hausman test, theory | Biased and inconsistent | IV/2SLS, panel FE, natural experiment |
| Omitted variable | Ramsey RESET test | Bias if correlated with X | Add controls, use FE, IV |
| Non-normality | Jarque-Bera test | Invalid small-sample inference | Larger sample, bootstrap, transform |
Interpreting coefficients:
Linear-linear: Y = a + bX → 1 unit increase in X → b unit change in Y
Log-linear: ln(Y) = a + bX → 1 unit increase in X → b*100% change in Y
Linear-log: Y = a + b*ln(X) → 1% increase in X → b/100 unit change in Y
Log-log: ln(Y) = a + b*ln(X) → 1% increase in X → b% change in Y (elasticity)
Panel data structure: Observations on N entities (firms, countries) over T time periods.
Pooled OLS:
Y_it = beta_0 + beta_1 * X_it + epsilon_it
Ignores panel structure. Inconsistent if entity-specific effects correlated with X.
Fixed Effects (FE) — Within Estimator:
Y_it = alpha_i + beta * X_it + epsilon_it
alpha_i = entity-specific fixed effect (absorbed / differenced out)
Advantages:
- Controls for all time-invariant unobserved heterogeneity
- Consistent even if alpha_i is correlated with X_it
- Most common panel estimator in applied economics
Limitations:
- Cannot estimate effects of time-invariant variables (industry, country dummies)
- Requires within-entity variation for identification
- Less efficient than RE if RE assumptions hold
Time fixed effects: Y_it = alpha_i + gamma_t + beta * X_it + epsilon_it
→ Also absorbs common shocks affecting all entities in each period
→ Two-way fixed effects (entity + time) is standard practice
Random Effects (RE) — GLS Estimator:
Y_it = beta_0 + beta * X_it + (alpha_i + epsilon_it)
alpha_i treated as random, uncorrelated with X_it
More efficient than FE if assumption holds
Can estimate coefficients on time-invariant variables
Hausman Test — FE vs RE:
H0: alpha_i uncorrelated with X_it (RE is consistent and efficient)
H1: alpha_i correlated with X_it (only FE is consistent)
If p-value < 0.05: Reject H0, use FE
If p-value > 0.05: Fail to reject, RE is preferred (more efficient)
In practice: FE is the default choice in most applied work because
the RE assumption is strong and often implausible
Clustered standard errors: In panel data, always cluster standard errors at the entity level to account for within-entity correlation of errors over time.
Problem: Endogeneity — X is correlated with epsilon (due to omitted variables, simultaneity, or measurement error). OLS is biased and inconsistent.
IV/2SLS approach:
Requirements for a valid instrument Z:
1. Relevance: Cov(Z, X) ≠ 0 (Z predicts X — testable)
2. Exclusion restriction: Cov(Z, epsilon) = 0 (Z affects Y only through X — NOT testable)
Two-Stage Least Squares (2SLS):
Stage 1: X_hat = gamma_0 + gamma_1 * Z + v (regress X on instrument)
Stage 2: Y = beta_0 + beta_1 * X_hat + epsilon (regress Y on predicted X)
Diagnostics:
- First-stage F-statistic: F > 10 indicates instrument is not weak (Staiger-Stock rule)
- Overidentification test (Sargan/Hansen J): If more instruments than endogenous variables,
test whether excluded instruments are uncorrelated with error (if rejected, at least one
instrument is invalid)
- Weak instruments: IV estimates are biased toward OLS; use LIML instead of 2SLS
Famous IV examples in economics:
| Endogenous Variable | Instrument | Paper |
|---|---|---|
| Education → Earnings | Quarter of birth | Angrist & Krueger (1991) |
| Institutions → Growth | Settler mortality | Acemoglu, Johnson, Robinson (2001) |
| Trade → Income | Geographic distance | Frankel & Romer (1999) |
| Police → Crime | Electoral cycles | Levitt (1997) |
Model:
Y_t = c + A_1 * Y_{t-1} + A_2 * Y_{t-2} + ... + A_p * Y_{t-p} + epsilon_t
Y_t = vector of endogenous variables (e.g., GDP growth, inflation, interest rate)
A_i = coefficient matrices
p = lag order (selected by information criteria: AIC, BIC, HQ)
epsilon_t = vector of error terms (serially uncorrelated)
VAR toolkit:
Stationarity requirements:
Y_it = beta_0 + beta_1 * Treat_i + beta_2 * Post_t + beta_3 * (Treat_i x Post_t) + epsilon_it
beta_3 = DiD estimator = causal effect of treatment
Key assumption: Parallel trends — absent treatment, treated and control groups
would have followed the same trend
Diagnostics:
- Pre-treatment trend test: Plot outcomes for treated vs control before treatment
- Placebo tests: Apply DiD to periods before treatment (should find no effect)
- Event study specification: Estimate treatment effect at each time period
=== REGRESSION RESULTS ===
Dependent variable: __________ N = ____ R-squared = ____
(1) OLS (2) FE (3) IV/2SLS
Variable 1 ____ ____ ____
(SE) (SE) (SE)
Variable 2 ____ ____ ____
(SE) (SE) (SE)
Variable 3 ____ ____ ____
(SE) (SE) (SE)
Constant ____ — ____
(SE) (SE)
Entity FE No Yes No
Time FE No Yes No
Clustered SEs No Entity No
First-stage F — — ____
Hausman test p — ____ —
Observations ____ ____ ____
R-squared ____ ____ ____
Standard errors in parentheses. * p<0.10, ** p<0.05, *** p<0.01
=== ECONOMETRIC DIAGNOSTIC CHECKLIST ===
Model: __________ Estimator: __________
[ ] Heteroskedasticity test (Breusch-Pagan / White): p = ____
→ If rejected: using robust SEs? [ ] Yes
[ ] Autocorrelation test (Durbin-Watson / Breusch-Godfrey): DW = ____
→ If detected: using Newey-West SEs? [ ] Yes
[ ] Multicollinearity (max VIF): VIF = ____
→ If VIF > 10: action taken? ____
[ ] Endogeneity (Hausman test for panel / theory for IV): p = ____
→ If suspected: IV or FE used? [ ] Yes
[ ] Specification (Ramsey RESET): p = ____
→ If rejected: functional form reviewed? [ ] Yes
[ ] Normality of residuals (Jarque-Bera): p = ____
→ If rejected and small sample: bootstrap used? [ ] Yes
[ ] Stationarity (ADF test on each variable): ____
→ If I(1): differenced or cointegration tested? [ ] Yes