評估模型表現
為了測試哪一種作法較佳——使用整個資料集的模型,或是針對各房屋屋齡類別分別建立的模型——你需要計算一些指標。這裡你會比較各模型的判定係數與殘差標準誤。
已提供 4 個「價格對便利商店數量」的模型(mdl_all_ages、mdl_0_to_15、mdl_15_to_30、mdl_30_to_45);已載入 dplyr 與 broom。
本練習屬於課程
R 的迴歸分析中級
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Get the coeff. of determination for mdl_all_ages
___
# Get the coeff. of determination for mdl_0_to_15
___
# Get the coeff. of determination for mdl_15_to_30
___
# Get the coeff. of determination for mdl_30_to_45
___