ANOVA for plant growth
In this exercise, you will perform a one-way ANOVA to compare means across three groups.
Such a task might pop up during the interviews for various sectors, including engineering, marketing, and medical services.
Recall that the assumptions of ANOVA are:
- Independence of cases
- Normal distributions
- Homogeneity (equality) of variances
You can check the two last assumptions with the Shapiro-Wilk test and Bartlett's test respectively.
The null hypothesis of a one-way ANOVA states that the means across groups are equal. $$ H_0: \mu_1 = \mu_2 = … = \mu_n $$
Use oneway.test()
to perform ANOVA in this exercise.
Watch out! So far, we've used tapply()
to compute descriptive statistics across groups. We can use this function to perform statistical tests across groups, too!
This exercise is part of the course
Practicing Statistics Interview Questions in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Test normality across groups
tapply(___, PlantGrowth$group, FUN = ___)
# Check the homogeneity of variance
___(___ ~ group, data = ___)