調整非常態誤差
在最後這個例子中,點似乎並不是繞著迴歸線呈常態分佈。再提醒一次,本練習中的修正同時會改變變異程度,也會影響關係的線性程度。
本練習屬於課程
R 中的線性迴歸推論
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Run this to see how the model looks
ggplot(hypdata_nonnorm, aes(x = explanatory, y = response)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE)
# Model response vs. explanatory
model <- ___
# Extract observation-level information
modeled_observations <- ___
# See the result
modeled_observations
# Using modeled_observations, plot residuals vs. fitted values
___