data-science-experimentation
Use when the user asks whether an A/B test result is statistically significant, sample size and power for an experiment, CUPED, sequential testing, sample…
от j4flmao★ 47 звёзд на GitHub
Установить data-science-experimentation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Experimentation
Purpose
Design and analyze rigorous A/B tests and experiments. Enforce proper sample size planning, pre-registration, statistical methods, guardrail monitoring, and decision frameworks.
Agent Protocol
Trigger
Exact user phrases: "A/B test", "experiment", "randomized trial", "sample size", "power analysis", "hypothesis test", "p-value", "multiple testing", "guardrail metric", "experiment design", "treatment effect", "H0", "alternative hypothesis", "statistical significance", "practical significance", "MDE", "minimum detectable effect".
Input Context
- Experiment type (A/B, multivariate, MAB, switchback)
- Primary metric(s) and their baseline values
- Minimum detectable effect (MDE) in absolute or relative terms
- Traffic volume and expected experiment duration
- Unit of randomization (user, session, cluster)
- Guardrail metrics and acceptable thresholds
- Regulatory and ethical considerations
- Existing experiment platform and tooling
Output Artifact
Experiment design with sample size calculation, analysis plan, and decision criteria.
Response Format
## Experiment Design
Hypothesis: {H0 and H1}
Primary Metric: {name, baseline, MDE}
Sample Size: {N per variant, total N}
Duration: {days} at {traffic allocation}
Analysis: {test type, corrections, covariates}
## Analysis Results
Treatment Effect: {estimate, CI, p-value}
Practical Significance: {effect size, decision}
Guardrails: {√ or ✗ per metric}
Completion Criteria
- Pre-registered hypothesis with H0 and H1
- Sample size calculated for desired power (80%+)
- Randomization method selected (simple, stratified, cluster)
- Primary metric defined with baseline and MDE
- Guardrail metrics defined with thresholds
- Statistical test selected (t-test, chi-square, etc.)
- Multiple testing correction applied
- Decision criteria: ship, iterate, or kill
Workflow
Step 1: Hypothesis Development
Formulate clear, falsifiable hypotheses. H0 (null): no effect. H1 (alternative): effect exists in specified direction. A good hypothesis: "Changing the checkout button color from blue to green will increase purchase conversion rate by at least 0.5 percentage points." Pre-register on experiment platform or in documentation before launch. Include rationale, prior evidence, and expected mechanism of action.
Step 2: Metric Selection
Primary Metric (OEC)
Define one overall evaluation criterion. Must be: sensitive to the change, reliable (low measurement variance), timely (can be measured during experiment window), and directional (higher or lower is clearly better). Examples: purchase conversion rate, revenue per user, retention rate (day 7), task completion rate.
Secondary Metrics
Related success indicators that might be affected. Examples: average order value, session duration, pages per session. Secondary metrics are reported but not used for the go/no-go decision.
Guardrail Metrics
Metrics that MUST NOT degrade even if primary metric improves. Examples: page load time, error rate, unsubscribes, support ticket volume, latency p99. Set acceptable thresholds upfront. A treatment that improves the primary metric but degrades a guardrail is usually not shipped.
Metric Standardization
Define metrics once in a central repository (SQL or Python). Store: metric name, SQL definition, owner, expected range, seasonality, guardrail assignment. Version control definitions. Consistent definitions across experiments enable comparability.
Step 3: Sample Size Calculation
Input Parameters
Baseline conversion rate (p0): current value of the metric. Minimum detectable effect (MDE): smallest effect worth detecting. Significance level (α): probability of false positive, typically 0.05. Statistical power (1-β): probability of detecting true effect, target ≥ 0.80. Allocation ratio: 1:1 (most efficient).
Formula for Proportions
n = (Z_(α/2) + Z_β)² × (p1(1-p1) + p2(1-p2)) / (p1 - p2)²
For continuous metrics: n = 2 × (Z_(α/2) + Z_β)² × σ² / δ²
Practical Examples
| Baseline | MDE (relative) | α | Power | N per variant |
|---|---|---|---|---|
| 5% | 10% (0.5pp) | 0.05 | 0.80 | ~31,200 |
| 5% | 20% (1.0pp) | 0.05 | 0.80 | ~8,200 |
| 10% | 10% (1.0pp) | 0.05 | 0.80 | ~14,800 |
| 10% | 5% (0.5pp) | 0.05 | 0.80 | ~57,800 |
| 20% | 10% (2.0pp) | 0.05 | 0.80 | ~6,500 |
Values are two-sided, per variant, from the pooled-variance formula in the code below; check with statsmodels.stats.power.NormalIndPower before committing traffic.
Step 4: Randomization
Randomization Methods
Simple: each unit assigned independently. Stratified: block by important covariates (country, platform, segment) to reduce variance. Cluster: group-level randomization when network effects exist (markets, regions). Re-randomization: reject unbalanced allocations (if used, must adjust inference).
Sample Ratio Mismatch (SRM)
Monitor daily: chi-square goodness-of-fit test on observe
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/experiment-design.md
- references/experimentation-advanced.md
- references/experimentation-fundamentals.md
- references/experimentation-platform.md
- references/metric-selection.md
- references/statistical-methods.md
FAQ
Что делает скилл data-science-experimentation?
Use when the user asks whether an A/B test result is statistically significant, sample size and power for an experiment, CUPED, sequential testing, sample ratio mismatch, multiple comparisons or bandits. Produces design, power calculation and analysis. Not for product A/B test strategy (use product-ab-testing) or observational causal studies (use data-science-causal-inference).
Как установить скилл data-science-experimentation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-science-experimentation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…