MulaiMulai sekarang secara gratis

Trend lines

Let's return to the bubble plot of Height versus Weight, colored by Gender, for 20 year olds. It's now time to add trends lines and compare the trend lines when we do and do NOT account for the survey weights.

Latihan ini adalah bagian dari kursus

Analyzing Survey Data in R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Add non-survey-weighted trend lines to bubble plot
ggplot(data = NHANES20, mapping = aes(x = Height, y = Weight, size = WTMEC4YR, color = Gender)) + 
  geom_point(alpha = 0.1) + 
  guides(size = "none") + 
  geom____(method = ___, se = FALSE, linetype = 2)
Edit dan Jalankan Kode