ml_predict | R Documentation |
Currently only works for models without alternative specific constants or alternative specific interaction effects.
ml_predict(mod, newdata, num.draws = 1000, use.halton = TRUE)
mod |
An estimated mlogit model |
newdata |
A data set for the prediction in long format. The data set should have a column alt the indexed the alternative. The data set must be ordered first by choice situation and each choice situation must have the same number of alternatives in the same order. You may simply add a column chid specifying choice situation then arrange by chid, alt. |
num.draws |
Number of simulated consumers to compute market shares (relevant for mixed logit models only) |
use.halton |
Should Halton sequences instead of pseudo-random numbers be used to simulate consumers (default TRUE) |
A matrix of predicted choice probabilities with one row per choice situation and one column for each alternative. Each row sums up to 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.