First random sample, second random sample
Now, you will dive in to understanding how linear models vary from sample to sample. Here two random samples from a population are plotted onto the scatterplot. The population data (called popdata) already exists and is pre-loaded, along with ggplot and dplyr.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Inference for Linear Regression in R
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Using popdata, plot response vs. explanatory
ggplot(___, aes(x = ___, y = ___)) +
# Add a point layer
___() +
# Add a smooth trend layer, using lin. reg., no ribbon
___(method = "___", se = ___)