economics-analysis

Economic analysis including econometrics, causal inference, time series economics, game theory, welfare analysis, and economic modeling. Use when user works with economic data, regression analysis, instrumental variables, difference-in-differences, RDD, panel data, or economic theory. Triggers on "econometrics", "regression", "causal inference", "instrumental variable", "difference-in-differences", "panel data", "game theory", "supply demand", "GDP", "inflation", "economic model".

564 stars

Best use case

economics-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Economic analysis including econometrics, causal inference, time series economics, game theory, welfare analysis, and economic modeling. Use when user works with economic data, regression analysis, instrumental variables, difference-in-differences, RDD, panel data, or economic theory. Triggers on "econometrics", "regression", "causal inference", "instrumental variable", "difference-in-differences", "panel data", "game theory", "supply demand", "GDP", "inflation", "economic model".

Teams using economics-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/economics-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/economics-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/economics-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How economics-analysis Compares

Feature / Agenteconomics-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Economic analysis including econometrics, causal inference, time series economics, game theory, welfare analysis, and economic modeling. Use when user works with economic data, regression analysis, instrumental variables, difference-in-differences, RDD, panel data, or economic theory. Triggers on "econometrics", "regression", "causal inference", "instrumental variable", "difference-in-differences", "panel data", "game theory", "supply demand", "GDP", "inflation", "economic model".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Economics Analysis

Econometrics and economic modeling. Venv: `source /Users/zhangmingda/clawd/.venv/bin/activate`

## Causal Inference Methods

### Selection Guide
| Method | When to Use | Key Assumption |
|--------|------------|----------------|
| RCT | Can randomize treatment | Random assignment |
| IV (2SLS) | Endogeneity, have instrument | Exclusion restriction |
| DiD | Policy change, panel data | Parallel trends |
| RDD | Treatment at threshold | Continuity at cutoff |
| Matching/PSM | Observational, rich covariates | Selection on observables |
| Synthetic Control | Aggregate intervention, few treated | Parallel trends (weighted) |

### Difference-in-Differences
```python
import statsmodels.formula.api as smf

# Basic DiD
model = smf.ols('outcome ~ treated * post + C(unit) + C(time)', data=df).fit(cov_type='cluster', cov_kwds={'groups': df['unit']})
print(model.summary())
# DiD estimate = coefficient on treated:post interaction
```

### Instrumental Variables (2SLS)
```python
from linearmodels.iv import IV2SLS

# Y = β₀ + β₁X + ε, where X is endogenous
# Z is the instrument
model = IV2SLS.from_formula('outcome ~ 1 + controls + [endogenous ~ instrument]', data=df)
result = model.fit(cov_type='robust')
print(result.summary)
```

### Regression Discontinuity
```python
# Local linear regression around cutoff
from sklearn.linear_model import LinearRegression

bandwidth = 5  # choose appropriately
cutoff = 0
left = df[(df['running'] >= cutoff - bandwidth) & (df['running'] < cutoff)]
right = df[(df['running'] >= cutoff) & (df['running'] <= cutoff + bandwidth)]

# Fit separate regressions
model_left = LinearRegression().fit(left[['running']], left['outcome'])
model_right = LinearRegression().fit(right[['running']], right['outcome'])

# RDD estimate
rdd_effect = model_right.predict([[cutoff]])[0] - model_left.predict([[cutoff]])[0]
```

## Panel Data

```python
from linearmodels.panel import PanelOLS, RandomEffects, BetweenOLS

df = df.set_index(['entity', 'time'])

# Fixed effects
fe = PanelOLS.from_formula('y ~ x1 + x2 + EntityEffects + TimeEffects', data=df)
fe_result = fe.fit(cov_type='clustered', cluster_entity=True)

# Random effects
re = RandomEffects.from_formula('y ~ x1 + x2', data=df)
re_result = re.fit()

# Hausman test: FE vs RE
# If significant → use FE
```

## Game Theory

```python
import numpy as np
from scipy.optimize import linprog

# Nash equilibrium (2-player, finite)
def find_nash_pure(payoff_A, payoff_B):
    """Find pure strategy Nash equilibria"""
    nash = []
    rows, cols = payoff_A.shape
    for i in range(rows):
        for j in range(cols):
            # Check if i is best response to j, and j is best response to i
            if payoff_A[i,j] == max(payoff_A[:,j]) and payoff_B[i,j] == max(payoff_B[i,:]):
                nash.append((i, j))
    return nash

# Example: Prisoner's Dilemma
A = np.array([[-1, -3], [0, -2]])  # Row player payoffs
B = np.array([[-1, 0], [-3, -2]])  # Column player payoffs
print(f"Nash equilibria: {find_nash_pure(A, B)}")
```

## Economic Data Sources

| Source | Data | Access |
|--------|------|--------|
| FRED (St. Louis Fed) | US macro data | `https://api.stlouisfed.org/fred/` |
| World Bank | Global development | `https://api.worldbank.org/v2/` |
| IMF | International finance | REST API |
| BLS | US labor statistics | REST API |
| OECD | OECD country data | REST API |
| Penn World Table | Cross-country GDP | Download |
| CNKI/CSMAR | Chinese economic data | Institutional access |

### FRED API
```bash
# Get GDP data (need API key)
curl -s "https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&file_type=json"
```

### World Bank API
```bash
curl -s "https://api.worldbank.org/v2/country/CHN/indicator/NY.GDP.MKTP.CD?format=json&per_page=20"
```

## Tips
- Always cluster standard errors at the treatment level
- Test parallel trends assumption for DiD
- Report first-stage F-statistic for IV (F > 10 rule of thumb)
- Use robust standard errors by default
- For Chinese economic research, consider CSMAR and CNKI databases
- Report economic significance alongside statistical significance

Related Skills

statistical-analysis

564
from beita6969/ScienceClaw

Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.

social-science-analysis

564
from beita6969/ScienceClaw

Social science research methods including survey design, qualitative analysis, content analysis, network analysis, psychometrics, and mixed methods. Covers sociology, psychology, political science, education, and communication studies. Use when user designs surveys, analyzes qualitative data, does content analysis, builds scales, or uses mixed methods. Triggers on "survey design", "qualitative analysis", "content analysis", "Likert scale", "thematic analysis", "grounded theory", "factor analysis", "SEM", "structural equation", "psychometrics", "interview coding".

scipy-analysis

564
from beita6969/ScienceClaw

Scientific computing and statistical analysis with SciPy, NumPy, and pandas. Use when: (1) statistical hypothesis testing, (2) optimization problems, (3) signal processing, (4) numerical integration, (5) data manipulation and analysis. NOT for: symbolic math (use sympy-math), machine learning (use sklearn directly), or visualization (use matplotlib-viz).

patent-analysis

564
from beita6969/ScienceClaw

Conducts patent landscape analysis including prior art searches, patent claim interpretation, freedom-to-operate assessment, and intellectual property strategy for scientific inventions; trigger when users discuss patents, prior art, IP protection, or technology licensing.

paper-analysis

564
from beita6969/ScienceClaw

Read, summarize, and critically analyze scientific papers. Extract key findings, methodology, limitations, and contributions. Use when user shares a paper (PDF/URL/DOI), asks to summarize a paper, critique methodology, extract data from a paper, compare papers, or do a critical review. Triggers on "summarize this paper", "analyze this study", "what does this paper say", "critique this methodology", "extract findings from".

nlp-analysis

564
from beita6969/ScienceClaw

Natural language processing for research including text mining, sentiment analysis, topic modeling, named entity recognition, text classification, and corpus analysis. Use when user needs to analyze text data, extract information from documents, do sentiment analysis, topic modeling, or text classification for research purposes. Triggers on "text mining", "sentiment analysis", "topic modeling", "NER", "named entity", "text classification", "word embeddings", "LDA", "corpus analysis", "word frequency", "TF-IDF".

meta-analysis

564
from beita6969/ScienceClaw

Perform quantitative meta-analysis with effect size calculation, forest plots, funnel plots, and heterogeneity assessment. Use when: user asks to combine results from multiple studies, calculate pooled effect sizes, assess publication bias, or create forest/funnel plots. NOT for: systematic review protocol (use systematic-review) or single-study statistics (use statsmodels-stats).

linguistics-analysis

564
from beita6969/ScienceClaw

Analyze language structures, typological features, and semantic change across languages

legal-analysis

564
from beita6969/ScienceClaw

Analyze legal contracts, extract clauses, and perform legal research with structured frameworks

geospatial-analysis

564
from beita6969/ScienceClaw

Performs geospatial data analysis including GIS operations, spatial statistics, remote sensing image processing, geocoding, and cartographic visualization; trigger when users discuss maps, coordinates, satellite imagery, spatial patterns, or geographic data.

genomics-analysis

564
from beita6969/ScienceClaw

Orchestrates a genomics analysis workflow from gene query through expression analysis to pathway enrichment. Use when investigating gene function, analyzing expression data, or performing pathway-level interpretation. NOT for pure protein structure modeling or drug-target interaction analysis.

genome-analysis

564
from beita6969/ScienceClaw

Performs genomics analyses including gene expression profiling, BLAST sequence alignment, GWAS interpretation, variant calling, and genome assembly tasks; trigger when the user mentions DNA/RNA sequences, SNPs, gene panels, or comparative genomics.