Simulate expected shares from a set of alternatives
Returns the expected shares of a specific set of alternatives based on an estimated model.
simulateShares(model, alts, priceName = NULL, alpha = 0.025)
model |
The output of a model estimated model using the |
alts |
A data frame of a set of alternatives for which to simulate shares. Each row is an alternative and each column an attribute corresponding to parameter names in the estimated model. |
priceName |
The name of the parameter that identifies price. Only
required for WTP space models. Defaults to |
alpha |
The sensitivity of the computed confidence interval, e.g. a
90% CI is obtained with |
A data frame with the estimated shares for each alternative in
alts
.
# 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") ) # Create a set of alternatives for which to simulate shares: alts <- subset(yogurt, obsID == 42, select = c("feat", "price", "dannon", "hiland", "yoplait") ) row.names(alts) <- c("dannon", "hiland", "weight", "yoplait") alts # Run the simulation using the estimated preference space MNL model: simulateShares(mnl_pref, alts)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.