5 Hypothesis Testing

The One-Way ANOVA Table in R

one_aov <- clean_oneway_data %>% 
  aov(formula = Sales ~ Type, data = .)
  
one_aov %>% 
  summary
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Type         3  76.85  25.615   10.49 0.000466 ***
## Residuals   16  39.08   2.443                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

In the table,

  • Df – degress of freedom
  • Sum Sq – sum of squares
  • Mean Sq – mean sum of squares
  • F value – value of \(F\) statistic
  • Pr(>F)\(p\)-value

Thus, from the table

\[\begin{align} SSB &= 76.85 & MSB &= 25.615 & F = 10.49\\ SSE &= 39.08 & MSE &= 2.443 & \\ \end{align}\]

Similar to when you look up at an F-table, the p-value can be computed using the following R code.

pf(q = 10.49, df1 = 3, df2 = 16, lower.tail = F)
## [1] 0.0004652698