ml_predict: Alternative predict function for mlogit objects

View source: R/predict.R

ml_predictR Documentation

Alternative predict function for mlogit objects

Description

Currently only works for models without alternative specific constants or alternative specific interaction effects.

Usage

ml_predict(mod, newdata, num.draws = 1000, use.halton = TRUE)

Arguments

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)

Value

A matrix of predicted choice probabilities with one row per choice situation and one column for each alternative. Each row sums up to 1.


skranz/mlogitExtras documentation built on July 5, 2023, 4:30 p.m.