EXERCISE 1
Consider the following table:
The null hypothesis is that there is no difference in mortality between the two groups, or in statistical terms, the evaluation of the differences observable between observed and expected frequencies under the null hypothesis.
Solution with R:
First, I need to recreate the table in the figure in an object. I use the matrix function to create a 2x2 contingency table. I insert in matrix the vector containing the numbers that will be distributed in 2 columns (indicate 2 after the comma).
TAB <- matrix(c(24, 11, 11, 15), 2)
I apply the chi-squared test with Yates' correction because 30<n<10030 < n < 10030<n<100.
chisq.test(TAB, correct=TRUE)
The result is not statistically significant.
EXERCISE 2
We want to check the effect of two toxic substances on two groups of animals:
Agent A, administered to 70 animals, caused the death of 22 individuals (48 survived).
Agent B, administered to 50 animals, caused the death of 24 individuals (26 survived).
Q: Do the two substances have the same effects on mortality or survival (H1), or should the observed differences be considered random (H0)?
I reconstruct the contingency table with R as seen previously.
TAB <- matrix(c(22, 24, 48, 26), 2)
chisq.test(TAB, correct=TRUE)
Again, the difference in deaths between Agent A and Agent B is not significant.
EXERCISE 3
To assess the effects of two herbicides, the number of plants that grew and those that did not grow in the respective plots was counted: plants grown, plants not grown, total.
Again, I reconstruct the contingency table and perform the exercise as before, applying Yates' correction because the sample size is between 30 and 100.
TAB <- matrix(c(12, 26, 6, 9), 2) chisq.test(TAB, correct=TRUE)
In this case as well, the difference is not significant.