# <1>mlogitライブラリを読み込む library(mlogit) # <2>ワークディレクトリーの設定 setwd("c:/R-data") # <3>データの読み込み ALL_AB <- read.table("logitAB.txt", header=TRUE) # <4>mlogit.dataでmlogit用に変換 dataAB <- mlogit.data(ALL_AB, varying = 4:5, sep = ".", shape= "wide", choice = "item.choice") ansAB <- mlogit(item.choice ~ price, data=dataAB) summary(ansAB)