library(palmerpenguins)
library(tidyverse)
Statistical tests
Slides in full screen Download PDF slides
1 Task
Note
Find the solution here.
1.1 Get started
We will again use the penguins
tibble from the palmerpenguins
package for this task.
So before you get started with the exercise, make sure that you load the palmerpenguins
package and the tidyverse
1.2 Compare the flipper length of penguins using statistical tests
Question: Does the mean flipper length differ between the 3 penguin species?
Do separate comparisons for
- Gentoo vs. Adelie
- Gentoo vs. Chinstrap
- Adelie vs. Chinstrap
Before you start, create a subset of each species as a vector.
For this, you can use the $
operator:
<- filter(penguins, species == "Adelie")$flipper_length_mm
adelie <- filter(penguins, species == "Chinstrap")$flipper_length_mm
chinstrap <- filter(penguins, species == "Gentoo")$flipper_length_mm gentoo
Follow the decision tree for statistical tests:
1.3 Extra
Create a plot to show the results of your tests. Choose one of the following:
- Create a boxplot with notches to visually compare differences in flipper length between species
- Make a plot showing the mean and standard error of the mean as pointrange or point with errorbars
Add a geom_signif()
layer to the plot you just created to indicate your test results