模型訓練
接下來,你會在 train.data 上估計一個羅吉斯迴歸反應模型。為此,請使用在模型選擇後保留下來的預測變數,來解釋 HOPPINESS 的購買機率。你將檢視 train.model,並使用 margins() 函式把結果與先前擬合的 extended.model 做比較。
本練習屬於課程
在 R 中建立反應模型
練習說明
- 在
train.data上估計一個羅吉斯迴歸反應模型。用price.ratio、FEAT.HOP、FEATDISPL.HOP解釋HOPPINESS。使用glm(),family參數設為binomial,並把結果指定給名為train.model的物件。 - 使用
margins()函式檢視train.model物件。 - 使用
margins()函式檢視extended.model物件。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Fit the logistic response model to train.data
___ <- glm(___, family = binomial, data = ___)
# Investigate the train.model
___
# Investigate the extended.model
___