A/B Testing in R
Lauryn Burleigh
Data Scientist
cor.test(~ Enjoy + Time, data = pizza,
method = "pearson")
library(ggplot2)
ggplot(pizza, aes(x = Enjoy,
y = Time)) +
geom_point()
ggplot(pizza, aes(x = Enjoy,
y = Time)) +
geom_point() +
geom_smooth(method = "lm")
linear <- lm(Time ~ Enjoy,
data = Pizza)
Enjoy <- 12
topredict <- data.frame(Enjoy)
prediction <- predict(linear,
newdata = topredict)
ggplot(pizza, aes(x = Enjoy, y = Time)) +
geom_point() +
geom_smooth(method = "lm") +
geom_hline(yintercept = prediction) +
geom_vline(xintercept = Enjoy)
ggplot(pizza, aes(x = Enjoy, y = Time,
color = Topping)) +
geom_point() +
geom_smooth(method = "lm")
ggplot(pizza, aes(x = Enjoy,
y = Time)) +
geom_point(aes(colour = Topping)) +
geom_smooth(method = "lm")
ggplot(pizza, aes(x = Enjoy,
y = EatAgain)) +
geom_point(aes(colour = Topping)) +
geom_smooth(method = "glm",
method.args =
list(family =
"binomial"))
Enjoy <- 12
ggplot(pizza2, aes(x = Enjoy,
y = EatAgain)) +
geom_point(aes(colour = Topping)) +
geom_smooth(method = "glm",
method.args =
list(family =
"binomial")) +
geom_vline(xintercept = Enjoy)
A/B Testing in R