Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

r-econometrics重新计量经济学

Agent Skill

r-econometrics 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,128

周安装

133

GitHub Stars

375

下载量

1,096
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:r-econometrics(重新计量经济学)
来源仓库:https://github.com/meleantonio/awesome-econ-ai-stuff
仓库路径:skills/r-econometrics
安装命令:
npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill r-econometrics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill r-econometrics

简介

r-econometrics 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 适用于研究检索类任务,可结合来源仓库和原始 README 核验具体用法。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和操作边界。
  • 安装前建议核实维护状态,避免触发联网或文件读写等敏感操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

R Econometrics

Purpose

This skill helps economists run rigorous econometric analyses in R, including Instrumental Variables (IV), Difference-in-Differences (DiD), and Regression Discontinuity Design (RDD). It generates publication-ready code with proper diagnostics and robust standard errors.

When to Use

  • Running causal inference analyses
  • Estimating treatment effects with panel data
  • Creating publication-ready regression tables
  • Implementing modern econometric methods (two-way fixed effects, event studies)

Instructions

Step 1: Understand the Research Design

Before generating code, ask the user:

  1. What is your identification strategy? (IV, DiD, RDD, or simple regression)
  2. What is the unit of observation? (individual, firm, country-year, etc.)
  3. What fixed effects do you need? (entity, time, two-way)
  4. How should standard errors be clustered?

Step 2: Generate Analysis Code

Based on the research design, generate R code that:

  1. Uses the fixest package - Modern, fast, and feature-rich for panel data
  2. Includes proper diagnostics:

- For IV: First-stage F-statistics, weak instrument tests - For DiD: Parallel trends visualization, event study plots - For RDD: Bandwidth selection, density tests

  1. Uses robust/clustered standard errors appropriate for the data structure
  2. Creates publication-ready output using modelsummary or etable

Step 3: Structure the Output

Always include:

# 1. Setup and packages
# 2. Data loading and preparation
# 3. Descriptive statistics
# 4. Main specification
# 5. Robustness checks
# 6. Visualization
# 7. Export results

Step 4: Add Documentation

Include comments explaining:

  • Why each specification choice was made
  • Interpretation of key coefficients
  • Limitations and assumptions

Example Prompts

  • "Run a DiD analysis with state and year fixed effects, clustering at the state level"
  • "Estimate the effect of X on Y using Z as an instrument"
  • "Create an event study plot showing treatment effects by year"
  • "Run a sharp RDD with optimal bandwidth selection"

Example Output

# ============================================
# Difference-in-Differences Analysis
# ============================================

# Setup
library(tidyverse)
library(fixest)
library(modelsummary)

# Load data
df <- read_csv("data.csv")

# Prepare treatment variable
df <- df %>%
  mutate(
    post = year >= treatment_year,
    treated = state %in% treatment_states,
    treat_post = treated * post
  )

# ----------------------------------------
# Main DiD Specification
# ----------------------------------------

# Two-way fixed effects
did_model <- feols(
  outcome ~ treat_post | state + year,
  data = df,
  cluster = ~state
)

# View results
summary(did_model)

# ----------------------------------------
# Event Study
# ----------------------------------------

# Create relative time variable
df <- df %>%
  mutate(rel_time = year - treatment_year)

# Event study regression
event_study <- feols(
  outcome ~ i(rel_time, treated, ref = -1) | state + year,
  data = df,
  cluster = ~state
)

# Plot coefficients
iplot(event_study,
      main = "Event Study: Effect on Outcome",
      xlab = "Years Relative to Treatment")

# ----------------------------------------
# Robustness: Alternative Specifications
# ----------------------------------------

# Different clustering
did_robust <- feols(
  outcome ~ treat_post | state + year,
  data = df,
  cluster = ~state + year  # Two-way clustering
)

# ----------------------------------------
# Export Results
# ----------------------------------------

modelsummary(
  list("Main" = did_model, "Two-way Cluster" = did_robust),
  stars = c('*' = 0.1, '**' = 0.05, '***' = 0.01),
  output = "results/did_table.tex"
)

Requirements

Software

  • R 4.0+

Packages

  • fixest - Fast fixed effects estimation
  • modelsummary - Publication-ready tables
  • tidyverse - Data manipulation
  • ggplot2 - Visualization

Install with:

install.packages(c("fixest", "modelsummary", "tidyverse"))

Best Practices

  1. Always cluster standard errors at the level of treatment assignment
  2. Run pre-trend tests for DiD designs
  3. Report first-stage F-statistics for IV (should be > 10)
  4. Use feols over lm for panel data (faster and more features)
  5. Document all specification choices in your code comments

Common Pitfalls

  • ❌ Not clustering standard errors at the right level
  • ❌ Ignoring weak instruments in IV estimation
  • ❌ Using TWFE with staggered treatment timing (use did or sunab() instead)
  • ❌ Not reporting robustness checks

References

Changelog

v1.0.0

  • Initial release with IV, DiD, RDD support

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.32%
按下载量换算420

Claude

29.27%
按下载量换算321

Cursor

19.47%
按下载量换算213

Gemini CLI

9.95%
按下载量换算109

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills