Code Studio: One-Way ANOVA (car)
Run the one-way ANOVA from The Basics of One-Way ANOVA, using car::Anova as in ANOVA in afex and car.
The program reads the name of a built-in dataset. For each, compare a measurement across groups:
PlantGrowth:weightbygroupchickwts:weightbyfeedInsectSprays:countbyspray
- Fit the model with
lm(), then runAnova(model, type = 2). - From the result, print the F statistic and the p-value for the group effect, rounded to 4 decimal places, and whether the difference is significant at 0.05:
F: 4.8461 p: 0.0159 Significant: TRUE
A very small p-value rounds to 0 at 4 decimal places. That isn't an error; it means p < 0.00005.
Hint: the result is a table. Its first row is the group effect, in the columns "F value" and "Pr(>F)".
(afex isn't available here: it needs more memory than an exercise is given. car gives the same F test.)
Run the one-way ANOVA from The Basics of One-Way ANOVA, using car::Anova as in ANOVA in afex and car.
The program reads the name of a built-in dataset. For each, compare a measurement across groups:
PlantGrowth:weightbygroupchickwts:weightbyfeedInsectSprays:countbyspray
- Fit the model with
lm(), then runAnova(model, type = 2). - From the result, print the F statistic and the p-value for the group effect, rounded to 4 decimal places, and whether the difference is significant at 0.05:
F: 4.8461 p: 0.0159 Significant: TRUE
A very small p-value rounds to 0 at 4 decimal places. That isn't an error; it means p < 0.00005.
Hint: the result is a table. Its first row is the group effect, in the columns "F value" and "Pr(>F)".
(afex isn't available here: it needs more memory than an exercise is given. car gives the same F test.)