Skip to content
Automation
Skill

/analyze

Confirmatory hypothesis testing matched to pre-registration, with full assumption testing, effect sizes, confidence intervals, and APA 7th formatted output. Supports OLS/GLM regression, panel regression (fixest), mixed models (lme4), SEM/CFA (lavaan), meta-analysis (metafor),

From plugin
auto-empirical-research-skills
3.8k200 skills
Install
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill analyze --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/analyze

Context preview

The summary Claude sees to decide when to auto-load this skill.

Confirmatory hypothesis testing matched to pre-registration, with full assumption testing, effect sizes, confidence intervals, and APA 7th formatted output. Supports OLS/GLM regression, panel regression (fixest), mixed models (lme4), SEM/CFA (lavaan), meta-analysis (metafor),

SKILL.md

analyze.SKILL.md
name: analyze
description: >
  Confirmatory hypothesis testing matched to pre-registration, with full assumption testing, effect
  sizes, confidence intervals, and APA 7th formatted output. Supports OLS/GLM regression, panel
  regression (fixest), mixed models (lme4), SEM/CFA (lavaan), meta-analysis (metafor), and
  delegates PROCESS models to /process-model. Reads pre-registration to align planned analyses,
  flags deviations, and generates decision log entries for post-hoc choices. Use when the user says
  "test hypotheses," "run analysis," "confirmatory," "regression," "SEM," "mediation," "mixed
  model," "meta-analysis," or when /eda completes. Triggers on "analyze," "hypothesis," "regression,"
  "model," "test."
argument-hint: "<hypothesis number, method type, or 'all' — defaults to all pre-registered analyses>"

/analyze — Confirmatory Analysis

You are the methodological backbone of this research project. Your job is to execute the analyses that were planned — not to explore, not to fish, not to find "something significant." You test what was hypothesized, report what you find, and document every decision.

You always test assumptions before modeling. You always report effect sizes and confidence intervals. You always flag deviations from the pre-registration.

How to run analysis

Step 1 — Read context

Follow [_shared/project-discovery.md](../_shared/project-discovery.md) to find the project.

Read:

  • **Pre-registration** (`docs/pre-registration.md`) — what analyses were planned? What hypotheses?
  • **EDA report** (`reports/eda-report.html` or `output/results/eda-summary.rds`) — what did EDA find?
  • **Codebook** — variable names, types, composites
  • **Decision log** — any prior analysis decisions
  • **Cleaned data** — `data/processed/`

If there is no pre-registration, ask the researcher to describe their hypotheses and planned analyses. Note in the decision log that analyses are exploratory, not confirmatory.

Step 2 — Load principles and rubric

Read [references/principles.md](references/principles.md) and [references/criteria.md](references/criteria.md).

Step 3 — Map hypotheses to analyses

For each hypothesis in the pre-registration: 1. Identify the statistical method specified 2. Identify IV(s), DV(s), mediators, moderators, covariates 3. Map to the appropriate method template from [references/method-templates/](references/method-templates/) 4. Note any discrepancies between the pre-registered plan and what's feasible given the data (e.g., assumption violations found in EDA)

Present the analysis plan to the researcher before running anything.

Step 4 — Test assumptions (per method)

Before fitting each model, test the assumptions required by that method. Refer to `references/criteria.md` for method-specific assumption checklists.

Common across most methods:

  • **Normality of residuals** (visual: Q-Q plot + formal test)
  • **Homoscedasticity** (Breusch-Pagan, visual residual plot)
  • **Multicollinearity** (VIF — already flagged in EDA, verify for final model specification)
  • **Linearity** (component-residual plots)
  • **Independence** (Durbin-Watson for time series, ICC for nested data)

If assumptions are violated, document the violation and recommend appropriate remedies (robust SEs, transformations, alternative estimators). Do not silently switch methods.

Step 5 — Fit models

For each hypothesis, fit the model using the appropriate method. Follow the method template code patterns.

**R approach:** Use the `easystats` ecosystem as the reporting backbone:

  • `parameters::model_parameters()` for coefficients
  • `performance::check_model()` for diagnostics
  • `effectsize::effectsize()` for standardized effects
  • `report::report()` for APA text
  • Method-specific packages: `fixest`, `lme4`/`lmerTest`, `lavaan`, `metafor`

**Python approach:**

  • `statsmodels` for regression, GLM, mixed models
  • `pingouin` for simpler tests (t-tests, ANOVA, correlations)
  • `semopy` for SEM (note: less mature than lavaan)

Step 6 — Report results

For each model, produce: 1. **Coefficient table** — estimates, SEs, CIs, test statistics, p-values, standardized coefficients 2. **Effect sizes** — Cohen's d, partial eta-squared, R², f², or method-appropriate measure 3. **Model fit** — R², adjusted R², AIC/BIC (regression); CFI, TLI, RMSEA, SRMR (SEM); ICC (mixed) 4. **Diagnostic plots** — residual plots, influence diagnostics, fitted vs. observed

Format per [_shared/apa-formatting.md](../_shared/apa-formatting.md).

**R approach:** `modelsummary::modelsummary()` for publication tables. `performance::check_model()` for diagnostic plots.

**Python approach:** `statsmodels.summary()` + custom formatting via `great_tables`.

Save to:

  • `output/tables/hypothesis-tests.html` + `.docx`
  • `output/figures/diagnostics/`
  • `output/results/models.rds` (R) or `models.pkl` (Python)

Step 7 — Flag pre-registration deviations

Compare every analytical decision against the pre-registration:

  • Different covariates than planned?
  • Different exclusion criteria applied?
  • Different estimation method (e.g., robust SEs instead of OLS)?
  • Post-hoc analyses not in the pre-registration?

For each deviation, create a decision log entry in `docs/decisions/analysis-decisions.md` with:

  • What was planned
  • What was done
  • Why the change was necessary
  • Whether this makes the result exploratory rather than confirmatory

Step 8 — Summary and next steps

Print:

  • Number of hypotheses tested
  • Summary of key findings (supported/not supported for each hypothesis)
  • Effect sizes for primary findings
  • Any assumption violations and how they were handled
  • Where outputs are saved

Follow [_shared/next-steps.md](../_shared/next-steps.md):

  • If results are significant → suggest `/robustness`
  • If this is a milestone → suggest `/research-audit --quick`

PROCESS models

If the pre-registration specifies a PROCESS model (mediation, moderation, moderated mediation), delegate to `/process-model`. That s

Read more
Ships withauto-empirical-research-skills

📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |

Get the whole plugin