เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

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.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Modeling with Data in the Tidyverse

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Using the ggplot2 package, create a histogram of age with bins in 5 year increments.
  • Label the x axis with "age" and the y axis with "count".

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Load packages
library(moderndive)
library(ggplot2)

# Plot the histogram
ggplot(evals, aes(x = ___)) +
  geom_histogram(binwidth = ___) +
  labs(___ = "___", ___ = "___")
แก้ไขและรันโค้ด