A/B Testing in R
Lauryn Burleigh
Data Scientist
In this course:
Group A
Group B
Wide Format
ID | Cheese | Pepperoni |
---|---|---|
01 | 5.21 | NA |
02 | 3.75 | NA |
03 | 6.32 | NA |
04 | NA | 6.53 |
05 | NA | 7.01 |
06 | NA | 6.98 |
Long Format
ID | Topping | Time |
---|---|---|
01 | Cheese | 5.21 |
02 | Cheese | 3.75 |
03 | Cheese | 6.32 |
04 | Pepperoni | 7.64 |
05 | Pepperoni | 7.98 |
06 | Pepperoni | 5.62 |
ID | Cheese | Pepperoni |
---|---|---|
01 | 5.21 | NA |
02 | 3.75 | NA |
03 | NA | 6.53 |
04 | NA | 7.01 |
ID | Topping | Time |
---|---|---|
01 | Cheese | 5.21 |
02 | Cheese | 3.75 |
03 | Pepperoni | 7.64 |
04 | Pepperoni | 7.98 |
library(tidyr)
longdf <- Pizza %>% pivot_longer(cols = c("Cheese", "Pepperoni"),
names_to = "Topping", values_to = "Time") %>%
na.omit()
library(ggplot2)
ggplot(Pizza, aes(x = Time,
fill = Topping)) +
geom_histogram()
library(ggplot2) ggplot(Pizza, aes(x = Time, fill = Topping)) +
geom_histogram() + facet_grid(Topping~.)
Difference between conditions
Trend between measures
A/B Testing in R