11 Hypothesis Testing

11.1 The Two-Way ANOVA Table with Main Effects Only

two_aov <- clean_twoway_data %>% 
  aov(formula = Yield ~ Fertilizer + Manure, data = .)
  
two_aov %>% 
  summary
##             Df Sum Sq Mean Sq F value Pr(>F)  
## Fertilizer   1  17.67  17.672   6.332 0.0222 *
## Manure       1  19.21  19.208   6.883 0.0178 *
## Residuals   17  47.44   2.791                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Similar to the One-Way ANOVA 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} SSR &= 17.67 & MSR &= 17.672 & F_C = 6.332\\ SSC &= 19.21 & MSC &= 19.208 & F_R = 6.883\\ SSE &= 47.44 & MSE &= 2.791 & \\ \end{align}\]

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

pf(q = 6.332, df1 = 1, df2 = 17, lower.tail = F)
## [1] 0.02219209
pf(q = 6.883, df1 = 1, df2 = 17, lower.tail = F)
## [1] 0.01779112

11.2 The Two-Way ANOVA Table with Interactions

two_aov2 <- clean_twoway_data %>% 
  aov(formula = Yield ~ Fertilizer*Manure, data = .)
  
two_aov2 %>% 
  summary
##                   Df Sum Sq Mean Sq F value Pr(>F)  
## Fertilizer         1  17.67  17.672   6.368 0.0226 *
## Manure             1  19.21  19.208   6.922 0.0182 *
## Fertilizer:Manure  1   3.04   3.042   1.096 0.3107  
## Residuals         16  44.40   2.775                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The interaction is not significant so we proceed on using the additive model (i.e., main-effects only).