2025-10-26

Considering a dataset about Penguin measurements

data(penguins)
head(penguins)
# A tibble: 6 × 8
  species island    bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
  <fct>   <fct>              <dbl>         <dbl>             <int>       <int>
1 Adelie  Torgersen           39.1          18.7               181        3750
2 Adelie  Torgersen           39.5          17.4               186        3800
3 Adelie  Torgersen           40.3          18                 195        3250
4 Adelie  Torgersen           NA            NA                  NA          NA
5 Adelie  Torgersen           36.7          19.3               193        3450
6 Adelie  Torgersen           39.3          20.6               190        3650
# ℹ 2 more variables: sex <fct>, year <int>

Is there a correlation between penguins’ bill length, flipper length, and body mass?

Results:

-The 3D Scatter plot seems to have an upward trend

-It can be represented by:

\(\text{z} = \beta_0+\beta_1x+\beta_2y +\varepsilon;\)

What is the distribution of penguins’ body mass?

ggplot(penguins_clean, aes(x = body_mass_g)) +
         geom_histogram(bins = 30, fill = "skyblue") +
         labs(x = "Body Mass (g)",
         title = "Distribution of Penguins' Body Mass")

Results:

-The histogram has a mostly bell shaped distribution with some left skew.

-The peak of the distribution is close to 3500, showing the most common body mass range for penguins is around 3400-3800 grams.

What is the average body mass of each penguin species?

Results

-Finding the average body mass for a penguin species can be found by using the formula: \(Average(m | s = s_k) = \frac{ \sum_{i = 1}^{n_k} m_{i,k}} {n_k}\)

-Gentoo penguins have a mean average body mass of just above 5000g (5kg)

-Chinstrap and Adelie penguins have a mean average body mass of close to 3750g (3.75kg)

Which penguin species has the most variation in bill length?

Results

-The variation in bill length was the highest in Chinstrap penguins, both in IQR variation and overall variation.