experimental-design
정보
이 스킬은 데이터 수집 전에 통계적으로 타당한 실험을 설계하는 데 도움을 주며, 무작위화, 블록화, 요인 설계 등의 방법을 다룹니다. 연구 설계, 그룹 할당, 혼란 변수 방지를 통한 해석 가능한 결과 보장에 관한 질문에 반응합니다. 실험 계획에 사용하세요; 검정력 분석이나 기존 데이터 분석에는 각각의 연계 스킬을 이용하십시오.
빠른 설치
Claude Code
추천npx skills add K-Dense-AI/claude-scientific-skills -a claude-code/plugin add https://github.com/K-Dense-AI/claude-scientific-skillsgit clone https://github.com/K-Dense-AI/claude-scientific-skills.git ~/.claude/skills/experimental-designClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Experimental Design
Overview
The design of a study — how units are assigned to conditions, what is held constant, what is varied, and in what structure — determines what questions the data can answer. No analysis can rescue a confounded or pseudoreplicated design after the fact. This skill is about the decisions made before data collection: picking a design that isolates the effect of interest, randomizing to license causal claims, blocking to remove known nuisance variation, and structuring multi-factor experiments so effects are estimable rather than tangled together.
The three ideas behind almost every good design (Fisher's principles):
- Randomization — assign treatments at random so that confounders, known and unknown, are balanced in expectation. This is what turns a comparison into a causal claim.
- Replication — independent repetition at the right level, so you can estimate variability and your effects aren't artifacts of a single unit. The most common fatal error is pseudoreplication: counting repeated measurements on the same unit as independent replicates.
- Blocking / local control — group similar units (by batch, day, site, litter) and randomize within blocks, removing that nuisance variation from the error term instead of letting it inflate noise.
This skill helps you choose among design types, generate the actual randomization or DOE layout (with reproducible scripts), and avoid the structural mistakes that make data uninterpretable.
When to Use This Skill
- Planning any comparative experiment or trial and deciding how to assign units
- Randomizing subjects/samples to arms (simple, blocked, stratified, or cluster)
- Removing nuisance variation by blocking or stratification
- Designing multi-factor experiments: full or fractional factorial, screening designs
- Optimizing a response over continuous factors (response-surface designs)
- Within-subject / repeated-measures, crossover, split-plot, or Latin-square designs
- Cluster- or group-randomized designs (sites, clinics, classrooms, litters)
- Deciding the number and level of replicates and avoiding pseudoreplication
- Sequential, group-sequential, or adaptive designs with interim analyses
- Laying out plates/batches and randomizing run order to defeat drift
Installation
uv pip install "numpy>=1.26" "pandas>=2.0" pyDOE3
pyDOE3 is the maintained successor to pyDOE/pyDOE2 and supplies factorial,
fractional-factorial, Plackett-Burman, central-composite, Box-Behnken, and
Latin-hypercube generators. The bundled scripts wrap it to return designs in real
factor units with named columns and randomized run order.
Choosing a design
Start from the question and the structure of your units, not from a favorite design.
What are you trying to learn?
│
├─ Compare a few predefined conditions (A vs B vs C)?
│ ├─ Units independent, possibly with a known nuisance factor (day, batch, site)?
│ │ → Completely randomized (no nuisance) or RANDOMIZED BLOCK design.
│ ├─ Each unit can receive every condition in sequence (washout possible)?
│ │ → CROSSOVER / repeated-measures design (more power, watch carry-over).
│ └─ You can only randomize groups, not individuals (schools, clinics)?
│ → CLUSTER-randomized design (analyze at the cluster level; see pseudoreplication).
│
├─ Screen MANY factors (5+) to find the few that matter?
│ → FRACTIONAL FACTORIAL or PLACKETT-BURMAN screening design.
│
├─ Quantify main effects AND interactions among a handful of factors?
│ → FULL 2^k FACTORIAL design.
│
├─ Find the settings that OPTIMIZE a response (curvature matters)?
│ → RESPONSE-SURFACE design: central composite or Box-Behnken.
│
└─ Explore a simulation/computer model over a continuous space?
→ SPACE-FILLING design: Latin hypercube.
Detailed guidance per branch:
- Randomization, blocking, stratification, controls →
references/randomization_and_blocking.md - Factorial, fractional-factorial, screening, response-surface, DOE concepts (aliasing, resolution) →
references/factorial_and_doe.md - Crossover, repeated-measures, split-plot, Latin-square, cluster, nested designs →
references/design_types.md - Sequential, group-sequential, and adaptive designs (interim analyses) →
references/sequential_and_adaptive.md
Generating the design
Two scripts produce ready-to-use, reproducible layouts. Run them from the skill's
scripts/ directory or add it to sys.path. Everything is seeded so the exact
schedule can be archived and regenerated — a requirement for trial registration
and good lab practice.
Randomization / allocation schedules — scripts/randomization.py
from randomization import (
simple_randomization, block_randomization,
stratified_block_randomization, cluster_randomization,
assign_factorial_runs, arm_balance,
)
# Permuted blocks keep the arms balanced throughout enrollment (use for n < ~100
# or sequential intake — simple randomization can drift out of balance with small n)
sched = block_randomization(n=60, arms=["treatment", "control"], seed=42)
# Balance a prognostic variable across arms by randomizing within each stratum
sched = stratified_block_randomization({"siteA": 30, "siteB": 30},
arms=["drug", "placebo"], ratio=(2, 1), seed=42)
# Randomize whole clusters, not individuals (the cluster is the unit)
sched = cluster_randomization(["clinic1", "clinic2", "clinic3", "clinic4"], seed=42)
arm_balance(sched) # sanity-check the counts per arm
sched.to_csv("allocation_schedule.csv", index=False)
Choosing among them: simple is fine for large n but can produce imbalance with
small n; block guarantees balance throughout; stratified block additionally
balances a known prognostic factor; cluster is mandatory when the intervention
is delivered at a group level. See references/randomization_and_blocking.md.
DOE matrices — scripts/doe_designs.py
from doe_designs import (
full_factorial, two_level_factorial, fractional_factorial,
plackett_burman, central_composite, box_behnken, latin_hypercube,
)
# Factors as real-world (low, high) ranges -> design comes back in real units
factors = {"temp_C": (20, 60), "conc_mM": (1, 10), "pH": (6, 8)}
# Full 2^3: all main effects + all interactions (8 runs), run order randomized
design = two_level_factorial(factors, seed=42)
# Screen 7 factors cheaply (main effects only)
many = {f"factor_{i}": (0, 1) for i in range(7)}
design = plackett_burman(many, seed=42)
# Optimize over 2 factors with curvature (response-surface)
design = central_composite({"temp_C": (20, 60), "conc_mM": (1, 10)}, seed=42)
design.to_csv("experimental_runs.csv", index=False)
Run order is randomized by default so factors aren't confounded with time/drift
(machine warm-up, reagent aging). See references/factorial_and_doe.md for picking
generators, reading the alias structure, and choosing resolution.
The mistakes that ruin studies
These are structural — they can't be fixed in analysis, only in design.
- Pseudoreplication. Treating repeated measurements of one unit as independent
replicates: 3 mice with 100 cells each is n = 3 (mice), not n = 300 (cells), for
any treatment applied to the mouse. The replicate must be at the level the
treatment is randomized. This single error invalidates a large share of published
experiments. Randomize and replicate at the right level; analyze with the nesting
respected (mixed model). See
references/design_types.md. - Confounding by a nuisance variable. Running all treatment samples on Monday and all controls on Tuesday confounds treatment with day. Randomize across, or block on, every nuisance factor you can name (batch, day, plate, technician, instrument, position).
- No or broken randomization. Convenience assignment (first-come → treatment) lets confounders sneak in. Use a seeded schedule and follow it.
- No proper control. Without a concurrent control (and, where relevant, a vehicle/sham and blinding), you can't separate the treatment effect from time, placebo, or handling effects.
- Batch effects mistaken for biology. In omics especially, process samples in a randomized/blocked order across batches; never let batch align with the condition.
- Edge/position effects on plates. Evaporation and thermal gradients make plate edges differ. Randomize or block sample positions; don't put all controls in column 1.
- Aliasing ignored in fractional designs. A low-resolution fractional factorial confounds main effects with interactions; know your alias structure before concluding a factor "has no effect."
- Optimizing without curvature. A two-level factorial can't detect a curved response; you'll miss an interior optimum. Use a response-surface design.
Workflow
- State the question, the unit, and the response. What is randomized? What is measured? At what level is a true independent replicate? This determines everything.
- List nuisance factors (batch, day, site, operator, position) — plan to block, stratify, or randomize across each.
- Pick the design using the decision tree and reference files.
- Decide replication at the correct level (and get n from the statistical-power skill for the chosen design).
- Generate the layout with
randomization.py/doe_designs.py, seeded. - Randomize run/processing order and plate/batch positions.
- Document the design, seed, and schedule (pre-register if possible) so the analysis is confirmatory and the layout is auditable.
- Match the analysis to the design — blocks, strata, clusters, and nesting must appear in the model (hand off to statistical-analysis / statsmodels).
Resources
Scripts
scripts/randomization.py— seeded allocation schedules:simple_randomization,block_randomization,stratified_block_randomization,cluster_randomization,assign_factorial_runs,arm_balance.scripts/doe_designs.py— DOE matrices in real units:full_factorial,two_level_factorial,fractional_factorial,plackett_burman,central_composite,box_behnken,latin_hypercube.
References
references/randomization_and_blocking.md— randomization methods, blocking, stratification, controls, blinding, batch/plate layout.references/factorial_and_doe.md— factorial and fractional designs, resolution and aliasing, screening, and response-surface methodology.references/design_types.md— completely randomized, randomized block, crossover, repeated-measures, split-plot, Latin-square, cluster, and nested designs; the pseudoreplication problem in depth.references/sequential_and_adaptive.md— group-sequential designs, alpha spending, interim stopping, and adaptive sample-size re-estimation.
Related skills
- statistical-power — required sample size / power for the design you've chosen.
- statistical-analysis — running and reporting the analysis after collection.
- statsmodels / pymc — fitting the models the design implies.
Key references
- Fisher, R. A. (1935). The Design of Experiments.
- Montgomery, D. C. (2019). Design and Analysis of Experiments (10th ed.).
- Hurlbert, S. H. (1984). Pseudoreplication and the design of ecological field experiments. Ecological Monographs, 54(2), 187–211.
- Lazic, S. E. (2016). Experimental Design for Laboratory Biologists.
GitHub 저장소
Frequently asked questions
What is the experimental-design skill?
experimental-design is a Claude Skill by K-Dense-AI. Skills package instructions and resources that Claude loads on demand, so Claude can perform experimental-design-related tasks without extra prompting.
How do I install experimental-design?
Use the install commands on this page: add experimental-design to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does experimental-design belong to?
experimental-design is in the Testing category, tagged testing, design and data.
Is experimental-design free to use?
Yes. experimental-design is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
연관 스킬
이 Claude Skill은 MMLU, GSM8K를 포함한 60개 이상의 표준화된 학술 과제에서 LLM 성능을 벤치마크하기 위해 lm-evaluation-harness를 실행합니다. 개발자들이 모델 품질을 비교하고, 학습 진행 상황을 추적하거나 학술 결과를 보고할 수 있도록 설계되었습니다. 이 도구는 HuggingFace와 vLLM 모델을 포함한 다양한 백엔드를 지원합니다.
이 스킬은 cron 표현식을 사용하여 Worker를 스케줄링하기 위한 Cloudflare Cron Triggers 구현에 관한 포괄적인 지식을 제공합니다. 주기적 작업, 유지보수 작업, 자동화된 워크플로우 설정 방법을 다루며, 잘못된 cron 표현식이나 시간대 문제 같은 일반적인 이슈들을 해결하는 방법을 포함합니다. 개발자들은 이를 통해 스케줄된 핸들러 구성, cron 트리거 테스트, Workflows 및 Green Compute와의 연동 작업을 수행할 수 있습니다.
이 Claude Skill은 Python 스크립트를 통해 로컬 웹 애플리케이션을 테스트하기 위한 Playwright 기반 툴킷을 제공합니다. 프론트엔드 검증, UI 디버깅, 스크린샷 캡처, 로그 확인 기능을 지원하며 서버 라이프사이클을 관리합니다. 브라우저 자동화 작업에 사용하되 컨텍스트 오염을 방지하기 위해 소스 코드를 읽지 않고 스크립트를 직접 실행하세요.
이 스킬은 테스트 통과를 확인한 후 체계적인 통합 옵션을 제시하여 개발자가 완성된 작업을 마무리하도록 돕습니다. 구현이 완료된 후 머지, PR 생성, 브랜치 정리와 같은 워크플로우를 안내합니다. 코드가 준비되고 테스트가 완료되었을 때 개발 프로세스를 체계적으로 마무리하기 위해 사용하세요.
