Data were collected on random samples of three different species of penguins, Gentoo, Chinstrap and Gentoo. In this exercise, we’ll restrict to comparing the bill depth in the Gentoo and Chinstrap varieties:
The question of interest is whether the average length of the Chinstrap and Gentoo penguins living in the Palmer Archipelago is different. Null Hypothesis:that the average bill length of Chinstrap penguins is equal to the average bill length of Gentoo Penguins. Alternative Hypothesis:The average bill length is different between Chinstrap and Gentoo penguins. Evidence for a difference will be assessed using a two-sample statistical test at the 5% significance level. A p-value less than 0.05 will be considered enough evidence decide that the average bill length is different between the two penguins.
| Gentoo (N=124) |
Chinstrap (N=68) |
Overall (N=192) |
|
|---|---|---|---|
| bill_length_mm | |||
| Mean (SD) | 47.5 (3.08) | 48.8 (3.34) | 48.0 (3.23) |
| Median [Min, Max] | 47.3 [40.9, 59.6] | 49.6 [40.9, 58.0] | 47.7 [40.9, 59.6] |
| Missing | 1 (0.8%) | 0 (0%) | 1 (0.5%) |
As we can see, Chinstrap penguins have a higher average bill length of 48.83mm compared to the Gentoo penguins 47.50mm. The median also shows a similar pattern, confirming the assumption that Chinstrap penguins have a longer bill on average.
This figure shows a boxplot graph displaying the bill lengths of the penguins by species, with the sample means indicated. Although there is some overlap between the two distributions, the distribution of bill lengths for Chinstraps penguins is shifted upward compared to the Gentoo penguins. The variability appears similar across both species, and there is no strong evidence of extreme outliers. In conclusion, the exploratory analysis suggests a difference in bill length between Chinstrap and Gentoo penguins, motivating a formal statistical comparison.
Next more formally, we test the null hypothesis that the population average bill length is equal for Chinstrap and Gentoo penguins against the alternative hypothesis that the population averages are different. A two-sample t-test was used to compare the average bill lengths between the two species.
##
## Welch Two Sample t-test
##
## data: bill_length_mm by species
## t = -2.706, df = 129.22, p-value = 0.00773
## alternative hypothesis: true difference in means between group Gentoo and group Chinstrap is not equal to 0
## 95 percent confidence interval:
## -2.3006212 -0.3572698
## sample estimates:
## mean in group Gentoo mean in group Chinstrap
## 47.50488 48.83382
This test produced a t-statistic of –2.706 with 129.22 degrees of freedom and a p-value of 0.00773. Since this p-value is less than 0.05, there is strong evidence against the null hypothesis. The 95% confidence interval for the difference in population means ranges from –2.30mm to –0.36mm. As this interval does not include zero, it indicates a statistically significant difference in average bill length between the Chinstrap and Gentoo penguins.
## # A tibble: 1 × 2
## lower_ci upper_ci
## <dbl> <dbl>
## 1 -2.35 -0.408
## Response: bill_length_mm (numeric)
## Explanatory: species (factor)
## # A tibble: 1 × 1
## stat
## <dbl>
## 1 -1.33
## # A tibble: 1 × 1
## p_value
## <dbl>
## 1 0.014
## alpha P x.bar 2-sided.lower 2-sided.upper
## 1 0.05 0.95 NA NA NA
```{r echo=FALSE, message=FALSE, warning=FALSE}
Chinstrap.bill <- penguins %>% filter(species %in% “Chinstrap”) %>% select(bill_length_mm) %>% drop_na(bill_length_mm) %>% as.data.frame()
normtol.int(Chinstrap.bill$bill_length_mm, alpha = 0.05, P = 0.95, side = 2)
There is strong evidence that suggests that the population average bill length differs between Chinstrap and Gentoo penguins in the Palmer Archipelago island in Antarctica. Chinstrap penguins have longer bills on average than Gentoo penguins.
The estimated difference in average bill length is around 1.33mm, with a 95% confidence interval indicating that Chinstrap penguins’ bills are between 0.36mm and 2.30mm longer than those of Gentoo penguins. While the difference is small, it represents a consistent small difference between the two species, and it may be useful for species identification between the Chinstrap and Gentoo penguins and further ecological studies in the future.