By oberving the box-and-whisker plot of linseed and horsebean, linseed has an approximately normal distribution because it appears to be symmetric, and the horsebean has a skewd left distibution since it has a longer tail on the left.
Let’s state the hypothesis test first.
\[H_0: mean_l - mean_h = 0\] \[H_A: mean_l - mean_h != 0\] Here, we will use 2-tailed sample t test.
mean.diff <- 218.75 - 160.20
df <- 12 + 10 - 2
pooled.var <-(52.24^2 * 11 + 38.63^2 * 9) / df
se.diff <- sqrt(pooled.var/11 + pooled.var/9)
t.obt <- mean.diff / se.diff
t.obt
## [1] 2.794803
p.value <- 2 * pt(abs(t.obt), df = df, lower.tail = F)
p.value
## [1] 0.01118485
Since the test statistics is 2.79 which is greater than the critical value of T is 2.08, and P-value is 0.01112 which is less than alpha/2 = 0.025, we can reject \[H_0\] and accept \[H_A\]. It means that these data provide strong evidence that average weights of chickens that were fed linseed and horsebean are different.
Type I error: We may incorrect reject a true null hypotheis. It means that the average weights of chickens that were fed linseed and horsebean are not different but we rejected it.
If we use alpha = 0.01, The critical t is 2.85 which is greater than t statistics and P-value is also greater than alpha/2 = 0.005. We fail to reject \[H_0\].