Start a fresh conversation. Replace the highlighted placeholders.
Use data-analysis to Using the R code conventions in `.claude/rules/r-code-conventions.md`, perform an end-to-end R data analysis of [dataset path] to achieve [analysis goal], producing exploratory diagnostics, regression specifications, publication-ready tables and figures, and a script reviewed by the r-reviewer agent.
Required inputs
[dataset path]
[analysis goal]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: data-analysisdescription: End-to-end R data analysis workflow from exploration through regression to publication-ready tables and figures.disable-model-invocation: trueargument-hint: "[dataset path or description of analysis goal]"allowed-tools: ["Read", "Grep", "Glob", "Write", "Edit", "Bash", "Task"]
Data Analysis
Run an end-to-end data analysis in R through 5 phases.
Phase 1: Setup and Data Loading
Read R code conventions from .claude/rules/r-code-conventions.md
Create script with proper header (title, author, purpose, inputs, outputs)
Load packages with library() (never require())
Set set.seed() if stochastic elements are involved
Load data using relative paths
Phase 2: Exploratory Data Analysis
Summary statistics (mean, sd, min, max, N)
Missingness patterns
Distributions of key variables
Bivariate relationships
Time patterns (if panel data)
Group comparisons
Save diagnostics to output/diagnostics/
Phase 3: Main Analysis
Use fixest for panel data with fixed effects (see /econometrics-r for detailed patterns)
Use lm/glm for cross-section
Cluster standard errors appropriately
Run multiple specifications (simple to complex)
Report both statistical and economic significance
For causal inference (IV, DiD, RDD), see /causal-inference-r for diagnostics and modern estimators
For spatial econometrics, see /econometrics-r for spdep/spatialreg patterns
Phase 4: Publication-Ready Output
Tables:modelsummary (preferred) or stargazer, export as .tex and .html
Figures:ggplot2 with project theme, explicit dimensions, white background, 300 DPI