Start a fresh conversation. Replace the highlighted placeholders.
Use python-panel-data to analyze [data file and panel identifiers] using [outcome and regressors] with [fixed effects and clustering], and produce Python code, a readable results table, coefficient interpretation, and relevant robustness checks.
Required inputs
[data file and panel identifiers]
[outcome and regressors]
[fixed effects and clustering]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: python-panel-datadescription: Panel data analysis with Python using linearmodels and pandas.workflow_stage: analysiscompatibility: - claude-code - cursor - codex - gemini-cliauthor: Awesome Econ AI Communityversion: 1.0.0tags: - python - pandas - linearmodels - panel-data
Python Panel Data
Purpose
This skill helps economists run panel data models in Python using pandas, statsmodels, and linearmodels, with correct fixed effects, clustering, and diagnostics.
When to Use
Estimating fixed effects or random effects models
Running difference-in-differences on panel data
Creating regression tables and plots in Python
Instructions
Follow these steps to complete the task:
Step 1: Understand the Context
Before generating any code, ask the user:
What is the unit of observation and panel identifiers?
Which outcomes and regressors are required?
What fixed effects or time effects are needed?
How should standard errors be clustered?
Step 2: Generate the Output
Based on the context, generate Python code that:
Loads and cleans the data with pandas
Sets a MultiIndex for panel structure
Fits the model using linearmodels.PanelOLS or RandomEffects
Outputs results in a readable table and optional LaTeX