# NOT RUN {
# Run a MNL model in the Preference Space:
library(logitr)
mnl_pref <- logitr(
data = yogurt,
choiceName = "choice",
obsIDName = "obsID",
parNames = c("price", "feat", "dannon", "hiland", "yoplait")
)
# Get the WTP implied from the preference space model
wtp_mnl_pref <- wtp(mnl_pref, priceName = "price")
# Run a MNL model in the WTP Space:
mnl_wtp <- logitr(
data = yogurt,
choiceName = "choice",
obsIDName = "obsID",
parNames = c("feat", "dannon", "hiland", "yoplait"),
priceName = "price",
modelSpace = "wtp",
options = list(startVals = wtp_mnl_pref$Estimate)
)
# Compare the WTP between the two spaces:
wtpCompare(mnl_pref, mnl_wtp, priceName = "price")
# }
Run the code above in your browser using DataLab