effect.gmnl | R Documentation |
This a helper function to obtain the individuals' conditional estimate of the either random parameters or willingness-to-pay.
effect.gmnl(x, par = NULL, effect = c("ce", "wtp"), wrt = NULL, ...)
x |
an object of class |
par |
a string giving the name of the variable with a random parameter. |
effect |
a string indicating what should be computed: the conditional expectation of the individual coefficients " |
wrt |
a string indicating with respect to which variable the willingness-to-pay should be computed. |
... |
further arguments. Ignorred. |
A named list where "mean
" contains the individuals' conditional mean for the random parameter or willingness-to-pay, and where "sd.est
" contains standard errors.
Mauricio Sarrias.
Greene, W. H. (2012). Econometric Analysis, Seventh Edition. Pearson Hall.
Train, K. (2009). Discrete Choice Methods with Simulation. Cambridge University Press.
gmnl
for the estimation of multinomial Logit models with individual parameters.
## Not run: ## Data data("TravelMode", package = "AER") library(mlogit) TM <- mlogit.data(TravelMode, choice = "choice", shape = "long", alt.levels = c("air", "train", "bus", "car"), chid.var = "individual") ## MIXL model with observed heterogeneity mixl.hier <- gmnl(choice ~ vcost + gcost + travel + wait | 1 | 0 | income + size - 1, data = TM, model = "mixl", ranp = c(travel = "t", wait = "n"), mvar = list(travel = c("income","size"), wait = c("income")), R = 30, haltons = list("primes"= c(2, 17), "drop" = rep(19, 2))) ## Get the individuals' conditional mean and their standard errors for lwage bi.travel <- effect.gmnl(mixl.hier, par = "travel", effect = "ce") summary(bi.travel$mean) summary(bi.travel$sd.est) ## Get the individuals' conditional WTP of travel with respect to gcost wtp.travel <- effect.gmnl(mixl.hier, par = "travel", effect = "wtp", wrt = "gcost") summary(wtp.travel$mean) summary(wtp.travel$sd.est) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.