domains / data / data-analysis / data-analysis

data-analysis

Skill card

combined

The two skills share the name 'data-analysis' but describe different procedures. The first is a general statistical methodology guide focused on decision framing, statistical rigor, and avoiding analytical pitfalls. The second is a specific, end-to-end R workflow for empirical research, including file structure, specific packages (fixest, modelsummary), and publication-ready output standards. Neither is a reproduction of the other; they are complementary but distinct approaches to data analysis.

Repositories

RepositoryPath
LeoYeAI/openclaw-master-skillsskills/data-analysis/SKILL.md
brycewang-stanford/Auto-Empirical-Research-Skillsskills/12-pedrohcgs-claude-code-my-workflow/dot-claude/skills/data-analysis/SKILL.md

Other copies

RoleRepositoryPath
peerLeoYeAI/openclaw-master-skillsskills/data-analysis/SKILL.md
peerbrycewang-stanford/Auto-Empirical-Research-Skillsskills/12-pedrohcgs-claude-code-my-workflow/dot-claude/skills/data-analysis/SKILL.md
adapterbrycewang-stanford/Auto-Empirical-Research-Skillsskills/15-Felpix-Studios-social-science-research/skills/data-analysis/SKILL.md
adapterbrycewang-stanford/Auto-Empirical-Research-Skillsskills/41-sticerd-eee-sewage-econometrics-check/skills/data-analysis/SKILL.md
adapterbrycewang-stanford/Auto-Empirical-Research-Skillsskills/14-luischanci-claude-code-research-starter/dot-claude/skills/data-analysis/SKILL.md
adapterbrycewang-stanford/Auto-Empirical-Research-Skillsskills/28-maxwell2732-paper-replicate-agent-demo/dot-claude/skills/data-analysis/SKILL.md

Combined skill

---
name: data-analysis
description: Comprehensive data analysis skill covering statistical methodology and an end-to-end R workflow for empirical research.
---

## When to Load
User asks about analyzing data, finding patterns, statistical testing, or running an R-based empirical analysis.

## Core Principle
Analysis without a decision is just arithmetic. Always clarify: **What would change if this analysis shows X vs Y?**

## Methodology First
Before touching data:
1. **What decision** is this analysis supporting?
2. **What would change your mind?**
3. **What data do you actually have**?
4. **What timeframe** is relevant?

## Statistical Rigor Checklist
- [ ] Sample size sufficient?
- [ ] Comparison groups fair?
- [ ] Multiple comparisons adjusted?
- [ ] Effect size meaningful?
- [ ] Uncertainty quantified?

## Analytical Pitfalls to Catch
- Simpson's Paradox
- Survivorship bias
- Comparing unequal periods
- p-hacking
- Correlation in time series
- Aggregating percentages

## R Workflow (If using R)

### Phase 1: Setup and Data Loading
1. Read `.claude/rules/r-code-conventions.md` if present.
2. Create R script in `scripts/R/` with proper header.
3. Load packages (`library()`, never `require()`).
4. Set seed: `set.seed(42)`.
5. Load and inspect dataset.

### Phase 2: Exploratory Data Analysis
- Generate summary statistics, distributions, and relationships.
- Save diagnostic figures to `output/diagnostics/`.

### Phase 3: Main Analysis
- Use `fixest` for panel data, `lm`/`glm` for cross-section.
- Cluster standard errors appropriately.
- Report effect sizes.

### Phase 4: Publication-Ready Output
- **Tables:** Use `modelsummary` or `stargazer`. Export as `.tex` and `.html`.
- **Figures:** Use `ggplot2` with project theme. Export as `.pdf` and `.png`.

### Phase 5: Save and Review
1. `saveRDS()` for all key objects.
2. Run `r-reviewer` agent on the script if available.
3. Address critical issues.

## Output Standards
1. **Lead with the insight**.
2. **Quantify uncertainty**.
3. **State limitations**.
4. **Recommend next steps**.

## Red Flags to Escalate
- User wants to "prove" a predetermined conclusion.
- Sample size too small.
- Data quality issues.
- Uncontrollable confounders.