en un clic
python-panel-data
// Panel data analysis with Python using linearmodels and pandas.
// Panel data analysis with Python using linearmodels and pandas.
Simplify and clean up code after changes are complete. Reduces complexity, improves readability, and ensures consistency.
Commit changes, push to remote, and create a pull request. Use for completing features or fixes ready for review.
Implements the Spec-Driven Development lifecycle (Intent, Requirements, Design, Tasks, Build) for structured feature development. Use when the user wants to scaffold a new feature spec, generate EARS requirements, create a technical design, break work into tasks, or check spec status. Trigger on keywords: sdd, spec-driven, ears requirements, feature spec.
Find and fix technical debt including duplicated code, dead code, outdated patterns, and code smells. Run at the end of sessions to clean up.
Run IV, DiD, and RDD analyses in R with proper diagnostics
Build and solve Walrasian general equilibrium models with theory derivations and Julia computation
| name | python-panel-data |
| description | Panel data analysis with Python using linearmodels and pandas. |
| workflow_stage | analysis |
| compatibility | ["claude-code","cursor","codex","gemini-cli"] |
| author | Awesome Econ AI Community |
| version | 1.0.0 |
| tags | ["python","pandas","linearmodels","panel-data"] |
This skill helps economists run panel data models in Python using pandas, statsmodels, and linearmodels, with correct fixed effects, clustering, and diagnostics.
Follow these steps to complete the task:
Before generating any code, ask the user:
Based on the context, generate Python code that:
pandaslinearmodels.PanelOLS or RandomEffectsAfter generating output:
# ============================================
# Panel Data Analysis in Python
# ============================================
import pandas as pd
from linearmodels.panel import PanelOLS
# Load data
df = pd.read_csv("panel_data.csv")
# Set panel index
df = df.set_index(["firm_id", "year"])
# Create treatment indicator
df["treat_post"] = df["treated"] * df["post"]
# Two-way fixed effects model
model = PanelOLS.from_formula(
"outcome ~ 1 + treat_post + EntityEffects + TimeEffects",
data=df
)
results = model.fit(cov_type="clustered", cluster_entity=True)
print(results.summary)
pandaslinearmodelsstatsmodelsInstall with:
pip install pandas linearmodels statsmodels