Exercise_5
Analyzing Body Mass Data of Gentoo Penguins
Objective: We will analyze body mass data of Gentoo penguins using R, perform normality tests, compare body masses between males and females, interpret the results, and visualize the data.
Tasks:
Load the dataset and filter it to include only Gentoo penguins (
species == "Gentoo"
).Perform a Shapiro-Wilk test (
shapiro.test()
) to check the normality of body mass (body_mass_g
) for Gentoo penguins.Separately, perform Shapiro-Wilk tests for body mass (
bill_length_mm
) of male and female Gentoo penguins.Interpret the results of the normality tests.
Visualize body mass distributions for Gentoo penguins, showing comparisons between males and females using appropriate plots.
Hints:
Use
shapiro.test()
for normality tests.Use subsetting or filtering (
subset()
ordplyr::filter()
) to select Gentoo penguins.Use
ggplot2
or base R plots for visualization.