Exploratory visualization of age
Let's perform an exploratory data analysis (EDA) of the numerical explanatory variable age. You should always perform an exploratory analysis of your variables before any formal modeling. This will give you a sense of your variable's distributions, any outliers, and any patterns that might be useful when constructing your eventual model.
Questo esercizio fa parte del corso
Modeling with Data in the Tidyverse
Istruzioni dell'esercizio
- Using the
ggplot2package, create a histogram ofagewith bins in 5 year increments. - Label the
xaxis with"age"and theyaxis with"count".
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Load packages
library(moderndive)
library(ggplot2)
# Plot the histogram
ggplot(evals, aes(x = ___)) +
geom_histogram(binwidth = ___) +
labs(___ = "___", ___ = "___")