ANOVA, single, and multiple factor experiments

Progettazione Sperimentale in R

Joanne Xiong

Data Scientist

ANOVA

  • Used to compare 3+ groups
  • An omnibus test:
    • won't know which groups' means are different without additional post hoc testing
  • Two ways to implement in R:
#one
model_1 <- lm(y ~ x, data = dataset)
anova(model_1)

#two
aov(y ~ x, data = dataset)
Progettazione Sperimentale in R

Single factor experiments

model_1 <- lm(y ~ x)
  • y = outcome variable
    • Tensile strength of different cotton fabrics
  • x = explanatory factor variable
    • Percent cotton in the fabric
Progettazione Sperimentale in R

Multiple factor experiments

model2 <- lm(y ~ x + r + s + t)
  • y = outcome
    • ToothGrowth length
  • x, r, s, t = possible explanatory factor variables
    • How much vitamin C & delivery method
Progettazione Sperimentale in R

Intro to Lending Club data

  • Lending Club is a U.S. based peer-to-peer loan company.
    • Data is openly available on Kaggle
  • Includes all loans issued from 2007-2015
  • Big!
    • 890k observations and 75 variables
Progettazione Sperimentale in R

Let's practice!

Progettazione Sperimentale in R

Preparing Video For Download...