Introduction to experimental design

Experimental Design in R

Joanne Xiong

Data Scientist

Intro to experimental design

  • Starts with a question (hypothesis)
  • Collecting & analyzing the data

alt text

Experimental Design in R

Steps of an experiment

  • Planning
    • dependent variable = outcome
    • independent variable(s) = explanatory variables
  • Design
  • Analysis
Experimental Design in R

Key components of an experiment

  • Randomization
  • Replication
  • Blocking
Experimental Design in R

Randomization

  • Evenly distributes any variability in outcome due to outside factors across treatment groups
  • Example:
    • double-blind medical trials
    • neither patient nor doctor knows which group has been assigned
    • group assignment is made randomly by 3rd party
Experimental Design in R

Recap: t-tests

  • t-tests help answer research questions
    data("mtcars")
    
t.test(x = mtcars$mpg, alternative = "two.sided", mu = 40)
library(broom)
tidy()
Experimental Design in R

Let's practice!

Experimental Design in R

Preparing Video For Download...