選択モデルを当てはめる
次は、mlogit パッケージの mlogit() 関数を使い、sportscar データで選択モデルを推定します。データはすでに読み込まれています。手順は lm() で回帰モデルを当てはめるときととてもよく似ています。
この演習はコースの一部です
Rで学ぶマーケティングのための選択モデリング
演習の手順
library()を使ってmlogitパッケージを読み込みます。choiceをseat、trans、convert、priceの関数として予測するモデルを当てはめます。数式の入力を埋めてください。m1オブジェクトを要約します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# load the mlogit library
# fit a choice model using mlogit() and assign the output to m1
m1 <- mlogit(___ ~ ___, data=sportscar)
# summarize the m1 object to see the output of the choice model