始める無料で始める

選択モデルを当てはめる

次は、mlogit パッケージの mlogit() 関数を使い、sportscar データで選択モデルを推定します。データはすでに読み込まれています。手順は lm() で回帰モデルを当てはめるときととてもよく似ています。

この演習はコースの一部です

Rで学ぶマーケティングのための選択モデリング

コースを見る

演習の手順

  • library() を使って mlogit パッケージを読み込みます。
  • choiceseattransconvertprice の関数として予測するモデルを当てはめます。数式の入力を埋めてください。
  • 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
コードを編集して実行