Nothing
## ----setup, include=FALSE, message=FALSE, warning=FALSE-----------------------
knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
message = FALSE,
fig.retina = 3,
comment = "#>"
)
## -----------------------------------------------------------------------------
library("logitr")
head(yogurt)
## -----------------------------------------------------------------------------
yogurt2 <- yogurt
brands <- c("weight", "hiland", "yoplait", "dannon")
yogurt2$brand <- factor(yogurt2$brand, levels = brands)
## -----------------------------------------------------------------------------
yogurt2 <- fastDummies::dummy_cols(yogurt2, "brand")
## -----------------------------------------------------------------------------
head(yogurt2)
## -----------------------------------------------------------------------------
mnl_pref_dummies <- logitr(
data = yogurt2,
outcome = 'choice',
obsID = 'obsID',
pars = c(
'price', 'feat', 'brand_yoplait', 'brand_dannon', 'brand_weight'
)
)
summary(mnl_pref_dummies)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.