預測購買行為與不確定性
log_mod2 購買行為模型可以讓你根據信用資料進行預測。在本練習中,你將使用一組新的資料 new_credit_data,並計算預測結果與信賴區間界線。
第 3 題練習中的模型(log_mod2)已在你的工作環境中可用。
本練習屬於課程
R 中的廣義加法模型(GAM)之非線性建模
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate predictions and errors
predictions <- ___(log_mod2, newdata = ___,
type = ___, se.fit = ___)
# Inspect the predictions
predictions