Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/panel-data-analyst
Expert panel data regression analysis with fixed effects and GMM
Passed 20 of 22 test cases with the skill, and 17 of 22 without it.
3 fixed17 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
I have a panel dataset of 500,000 observations containing firm-year observations across 10,000 firms and 20 years. I need to run a linear regression in Stata absorbing both firm and year fixed effects while clustering standard errors at the firm level. Using regress or standard xtreg with dummy indicators creates thousands of dummy variables and runs out of memory. How should this two-way fixed effects model be estimated in Stata?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends using the reghdfe command in Stata. | Passed | Passed |
| Specifies firm_id and year inside the absorb option. | Missed | Passed |
The instructions your model reads when the skill loads.
Perform expert-level panel data regression analysis including fixed effects, random effects, dynamic panel models (Arellano-Bond/Blundell-Bond GMM), and advanced diagnostic tests. This skill covers the full workflow from panel setup through model selection, estimation, and publication-ready reporting.
Panel data -- repeated observations on the same cross-sectional units over time -- is the workhorse of modern empirical economics, finance, political science, and management research. Panel methods exploit both cross-sectional and temporal variation, enabling researchers to control for unobserved heterogeneity that would bias ordinary cross-sectional estimates.
The choice between fixed effects, random effects, and dynamic panel estimators depends on the data structure, the nature of unobserved heterogeneity, and the identifying assumptions the researcher is willing to make. This skill provides a systematic decision framework and implementation in both Stata and R, with emphasis on the diagnostic tests that justify model selection.
Beyond basic FE/RE models, this skill covers the advanced techniques increasingly required by journal reviewers: instrumental variables within panel frameworks, Driscoll-Kraay standard errors for cross-sectional dependence, correlated random effects (Mundlak/Chamberlain), and system GMM for dynamic panels with endogenous regressors.
* Stata panel setup
xtset firm_id year
xtset // Verify panel structure
* Check panel balance
xtdescribe
* Shows: min/max/avg observations per panel, gaps
* Summary statistics by panel dimension
xtsum revenue profit employees rnd_spending
* Reports overall, between, and within variation
* Check for gaps in panel
xtset firm_id year
gen gap = year - l.year if l.year != .
tab gap // Should be all 1's for balanced annual panels
* Create balanced subsample
by firm_id: gen T_i = _N
test cases passed, vs 17 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.