開始使用免費開始

評估與比較插補結果

建立插補模型時,最好與其他方法比較。在本課中,我們要將先前用 impute_lm() 產生的插補資料集,與以平均值插補的資料集進行比較。這兩個資料集已包含在本練習中,分別為 ocean_imp_lm_windocean_imp_mean

本練習屬於課程

在 R 中處理遺漏值

檢視課程

練習說明

  • 使用 bind_rows() 將兩個模型合併,把 ocean_imp_mean 指定到 mean,把 ocean_imp_lm_wind 指定到 lm_wind
  • 以散佈圖檢視 air_temphumidity 的數值,將 air_temp_c 放在 x 軸、humidity 放在 y 軸,依是否為遺漏值著色,並依所使用的插補模型(imp_model)進行分面。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Bind the models together 
bound_models <- bind_rows(mean = ___,
                          lm_wind = ___,
                          .id = "imp_model")

# Inspect the values of air_temp and humidity as a scatter plot
ggplot(___, 
       aes(x = ___, 
           y = ___, 
           color = any_missing)) +
  geom_point() + 
  facet_wrap(~___)
編輯並執行程式碼