2023-09-18
Response | Explanatory |
---|---|
y | x |
outcome | predictor |
dependent variable | independent variable |
covariate | |
feature |
Model notation: \(y \sim x\)
Categorical Response vs Categorical Explanatory
Always double check your work
One of the most common places for a mistake when creating a plot or a table between two categorical variables is by not paying close attention to the choice of denominator. And then also confirming the interpretation matches the table, which matches the plot.
Row Percents
Biscoe Dream Torgersen
Adelie 0.29 0.37 0.34
Chinstrap 0.00 1.00 0.00
Gentoo 1.00 0.00 0.00
29% of Adelie penguins are on Biscoe Island.
Distribution of islands for each species
29% of Adelie penguins are on Biscoe Island.
Quantitative Response vs Categorical Explanatory
Mean, median, sd, IQR of the quantitative variable for each level of the categorical level.
# A tibble: 3 × 5
species mean median sd IQR
<fct> <dbl> <dbl> <dbl> <dbl>
1 Adelie 18.3 18.4 1.22 1.5
2 Chinstrap 18.4 18.4 1.14 1.90
3 Gentoo 15.0 15 0.981 1.5
Gentoo penguins have lower average bill depth compared to Adelie or Chinstrap (15.0mm vs 18.3 and 18.4mm respectively). Chinstrap however have a larger IQR at 1.9 compared to 1.5 for the others.
Overlaid density plots
The distribution of bill depth are fairly normal for each species, with some higher end values causing a slight right skew for Adelie and Gentoo.
Quantitative Response vs Quantitative Explanatory
[1] 0.8712018
The penguin flipper length (mm) has a strong positive correlation with body mass (g), r=0.87
The relationship between flipper length and body mass in penguins is relatively linear, but there may be possible clustering on a third variable. There appears to be two groups below and above a flipper length of about 205mm.