Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
beita6969 avatar

Economics Analysis

  • 18 installs
  • 869 repo stars
  • Updated June 8, 2026
  • beita6969/scienceclaw

economics-analysis is a Claude skill that performs econometric and economic-modeling analysis, including causal inference, panel data, and game theory in Python.

About

This skill guides econometric and economic-modeling work in Python, covering causal inference (DiD, instrumental variables, regression discontinuity), panel data models, and game theory. A developer uses it when analyzing economic data, estimating treatment effects, or pulling macro series from sources like FRED and the World Bank. It provides method-selection guides and code templates using statsmodels and linearmodels.

  • Runs econometric methods: DiD, IV/2SLS, RDD, panel fixed/random effects
  • Includes a causal-inference method selection guide keyed to assumptions
  • Pulls macro data from FRED, World Bank, IMF, BLS, OECD sources

Economics Analysis by the numbers

  • 18 all-time installs (skills.sh)
  • Ranked #1,276 of 2,065 Data Science & ML skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
At a glance

economics-analysis capabilities & compatibility

Free to run; a FRED API key is needed to pull US macro data.

Capabilities
exploratory data analysis · experiment design
Use cases
data analysis · research
Pricing
Free
From the docs

What economics-analysis says it does

Economic analysis including econometrics, causal inference, time series economics, game theory, welfare analysis, and economic modeling.
SKILL.md
Report first-stage F-statistic for IV (F > 10 rule of thumb)
SKILL.md
npx skills add https://github.com/beita6969/scienceclaw --skill economics-analysis

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs18
repo stars869
Last updatedJune 8, 2026
Repositorybeita6969/scienceclaw

What it does

Use it when running econometric or causal-inference analysis on economic and macro data with Python (statsmodels, linearmodels).

Who is it for?

Analyzing economic data with causal-inference methods like difference-in-differences, instrumental variables, and panel regressions.

Skip if: General-purpose data analysis unrelated to economics or econometrics.

When should I use this skill?

The user works with economic data, regression analysis, causal inference, or economic theory.

What you get

Produces correctly specified econometric estimates with appropriate standard errors and assumption checks.

  • Econometric model estimates
  • Causal inference results with clustered standard errors

By the numbers

  • 6-method causal-inference selection guide
  • 7 economic data sources listed

Files

SKILL.mdMarkdownGitHub ↗

Economics Analysis

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

Causal Inference Methods

Selection Guide

MethodWhen to UseKey Assumption
RCTCan randomize treatmentRandom assignment
IV (2SLS)Endogeneity, have instrumentExclusion restriction
DiDPolicy change, panel dataParallel trends
RDDTreatment at thresholdContinuity at cutoff
Matching/PSMObservational, rich covariatesSelection on observables
Synthetic ControlAggregate intervention, few treatedParallel trends (weighted)

Difference-in-Differences

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)

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

# 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

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

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

SourceDataAccess
FRED (St. Louis Fed)US macro datahttps://api.stlouisfed.org/fred/
World BankGlobal developmenthttps://api.worldbank.org/v2/
IMFInternational financeREST API
BLSUS labor statisticsREST API
OECDOECD country dataREST API
Penn World TableCross-country GDPDownload
CNKI/CSMARChinese economic dataInstitutional access

FRED API

# 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

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

FAQ

Which causal inference methods does it cover?

RCT, IV (2SLS), difference-in-differences, regression discontinuity, matching/PSM, and synthetic control.

What data sources does it reference?

FRED, World Bank, IMF, BLS, OECD, Penn World Table, and CSMAR/CNKI for Chinese data.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.