Experimental Design in R
Learn to plan experiments in R, size them with power analysis, and analyze blocked, Latin square and factorial designs with ANOVA and A/B tests.
Experimental design is how you set up a study so that data can answer a question. Working in R, you randomize, replicate and block, estimate the power and sample size an experiment needs, compare groups with t-tests, ANOVA and A/B tests, and arrange treatments in blocked, Latin square and factorial layouts using survey, school test score and loan data.
What You Will Achieve
- Estimate the power and sample size an experiment needs before any data are gathered
- Compare group means with analysis of variance or a rank sum test, then judge the fit with validation plots
- Set up an A/B test, choose its sample size and pick the right follow-up test
- Draw block, Latin square and factorial layouts with agricolae and analyze the results in R
Program Overview
Experimental Design Basics and Power
The core parts of an experiment and the calculations that show how many observations it needs.
- Randomization, replication and blocking
- One-sided and two-sided hypothesis tests
- Power and sample size calculations with the pwr package
ANOVA, Model Validation and A/B Testing
Lending Club loan data serve as the test bed for single and multiple factor experiments, checks on the fitted models, and a basic A/B test.
- Exploratory analysis of the loan dataset
- Single and multiple factor ANOVA experiments
- Pre-modeling and post-modeling validation, plus the Kruskal-Wallis test
- A/B test sizing and how it compares with multivariable experiments
Block, Latin Square and Factorial Designs
NHANES survey records and NYC SAT scores are prepared and cleaned, then used for blocked, square and factorial experiments drawn with agricolae.
- Randomized complete and balanced incomplete block designs on NHANES data
- Checking whether a BIBD is possible and valid
- Latin and Graeco-Latin squares on SAT scores with missing values handled
- Factorial experiments and evaluating the factorial model
Certificate Awarded (Paid)
Job Outlook
Designing and analyzing experiments is part of data analysis work in business, health and technology settings, wherever a question has to be answered with evidence drawn from data.
Good for: Analysts and researchers who want to set up experiments in R and choose a design that fits the factors they need to control.
Keep in mind: A/B testing takes up part of one chapter, next to ANOVA; most of the course is spent on block, Latin square and factorial designs drawn with agricolae.
Bottom line: A tour of classical experimental designs, each one drawn in R with agricolae and applied to real survey, school or loan data.
Frequently Asked Questions
What data do the experiments run on?
The exercises use three real datasets: CDC NHANES survey records for the block designs, New York City public school SAT scores for the Latin square and factorial work, and Lending Club loan data for the ANOVA and A/B test lessons. R's built-in data and a cat kidney function example also appear.
Which R packages does the course rely on?
Power and sample size work uses the pwr package, including a lesson spent exploring its help documentation. The block, Latin square and Graeco-Latin square layouts are drawn with the agricolae package before each one is analyzed.
How are block designs handled in the course?
After building and cleaning a resampled NHANES dataset, you construct a randomized complete block design and validate it, then move on to balanced incomplete block designs, including how to tell whether one is possible and tips that keep it valid. One exercise also asks you to spot a poor blocking factor.
What does the A/B testing part include?
Working with the Lending Club data, you calculate the sample size for an A/B test, run a basic one, decide which test to apply afterward, and compare A/B tests with multivariable experiments.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.