experimental-design
Design experiments and studies BEFORE data is collected — choosing a design, randomizing, blocking, and laying out treatment combinations so the results will actually be interpretable. Use whenever someone is planning a study, asks how to assign subjects/samples to groups, mentions randomization, blocking, stratification, controls, factorial or fractional-factorial designs, design of experiments (DOE), screening many factors, response-surface optimization, crossover or repeated-measures or split-plot designs, cluster/group randomization, Latin squares, plate layouts, batch/run-order effects, replication vs. pseudoreplication, or sequential/adaptive/group-sequential designs. Trigger this even for informal phrasings like "how should I set up this experiment", "how do I avoid confounding", "what's the best way to test these 6 factors", or "assign these mice to conditions". For computing the sample size or power once the design is chosen, use statistical-power; for analyzing data already collected, use statistical-analysis.
Author
Category
Product DesignInstall
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Experimental Design - Experimental Design and Randomized Grouping Tool
Skill Overview
Experimental Design is a Claude skill specifically designed for the research design phase before data collection. It helps you plan experiments, perform randomized group assignments, avoid confounding and pseudoreplication, and generate DOE (Design of Experiments) matrices through reproducible scripts, ensuring that research results are genuinely interpretable.
Applicable Scenarios
1. Multifactor Experimental Design and Screening
When you need to test the effects of multiple factors simultaneously (five or more), this skill can generate fractional factorial designs or Plackett–Burman screening designs, helping you identify the most important factors with the fewest experiments. It is suitable for industrial optimization, formulation development, process parameter screening, and similar applications.
2. Clinical Trials and Sample Randomization
When conducting drug testing, intervention studies, or assigning participants to different groups, the skill provides various approaches, including simple randomization, block randomization, stratified block randomization, and cluster randomization. Each approach uses a seed to generate reproducible allocation tables, meeting the requirements of trial registration and good laboratory practice.
3. Response Surface Optimization and Experimental Layout Optimization
When you need to identify optimal settings for continuous factors (such as temperature, concentration, or pH) or address systematic drift related to treatment-plate layouts and batch order, the skill can generate response surface designs such as central composite and Box–Behnken designs, as well as Latin square designs, helping you discover optimal parameter combinations and avoid position and batch effects.
Core Features
1. Randomized Grouping and Allocation Scheme Generation
The
randomization.py script provides multiple randomization approaches:All approaches use random seeds, allowing allocation results to be reproduced precisely.
2. DOE Matrix Generation (Based on pyDOE3)
The
doe_designs.py script directly generates design matrices in real-world units:The default run order is randomized to prevent confounding between factors and temporal drift.
3. Prevention of Experimental Design Errors
This skill explicitly identifies common structural errors in experiments and provides corresponding solutions:
Frequently Asked Questions
What is randomization in experimental design, and why is it important?
Randomization is the process of assigning treatments to experimental units. It balances known and unknown confounding factors at random, providing a basis for causal inference in comparisons between groups. Without randomization, differences between groups may result from selection bias or other unmeasured variables. Experimental Design provides reproducible randomization scripts to ensure that the allocation process is both random and traceable.
How can pseudoreplication be avoided in experiments?
Pseudoreplication refers to treating repeated measurements from the same unit (such as one mouse) as independent replicates. The correct approach is to replicate and randomize at the level at which treatment is assigned, and to use mixed-effects models in the analysis to account for the nested structure. This skill explicitly states that “replication must occur at the level of treatment randomization” and helps you identify the true number of experimental units.
What is the difference between a block design and complete randomization?
Complete randomization is appropriate when there are no known nuisance factors; block designs are used to eliminate known sources of nuisance variation (such as batch, date, or location). Block designs group similar units together and randomize within each group, thereby removing nuisance variation from the error term and improving statistical power. Experimental Design provides stratified block randomization to balance known prognostic factors while maintaining randomization.
How should a multifactor experimental design be selected?
The choice depends on your objective:
This skill includes a complete design decision tree to help you select an appropriate design based on your research question.
How should an experiment be designed when the sample size is insufficient?
Small samples require even more careful design. Use block randomization to control known sources of nuisance variation, crossover designs to improve statistical power, or consider sequential/adaptive designs to re-estimate the sample size midway through the study. However, sample size calculations should be completed during the design stage, potentially in conjunction with the statistical-power skill to determine the required number of replicates. Experimental Design emphasizes that “the design determines which questions can be answered,” rather than attempting to remedy limitations during the analysis stage.