effect.gmnl: Get the Conditional Individual Coefficients

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/gmnl.methods.R

Description

This a helper function to obtain the individuals' conditional estimate of the either random parameters or willingness-to-pay.

Usage

1
effect.gmnl(x, par = NULL, effect = c("ce", "wtp"), wrt = NULL, ...)

Arguments

x

an object of class gmnl.

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 "ce", or the conditional expectation of the willingness-to-pay "wtp".

wrt

a string indicating with respect to which variable the willingness-to-pay should be computed.

...

further arguments. Ignorred.

Value

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.

Author(s)

Mauricio Sarrias.

References

See Also

gmnl for the estimation of multinomial Logit models with individual parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## 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) 

gmnl documentation built on July 1, 2020, 6:01 p.m.

Related to effect.gmnl in gmnl...