| interpret | R Documentation |
This function translates the posterior draws to scales that are easier to interpret:
A compensation says how many units of a reference covariate, for example the price, are worth one unit of another covariate, leaving the utility and hence the choice probabilities unchanged.
A marginal effect says by how much the choice probability of an alternative changes per unit of a covariate, computed by finite differences of the predicted probabilities.
Both are reported with their posterior uncertainty.
interpret(
object,
type = c("compensation", "ame", "mea"),
reference = NULL,
effects = NULL,
at = NULL,
level = 0.95,
progress = interactive()
)
## S3 method for class 'RprobitB_interpretation'
print(x, digits = 3L, ...)
object |
[ |
type |
[
|
reference |
[ |
effects |
[ |
at |
[ |
level |
[ |
progress |
[ |
x |
[ |
digits |
[ |
... |
Currently not used. |
A data.frame of class RprobitB_interpretation with one row per
quantity and the columns mean, sd, lower, and upper of its
posterior distribution. Compensations have a column effect and, for a
mixture model, a column class; marginal effects have the columns
covariate and alternative.
The utility of an alternative is linear in the covariates, so an increase
of one unit in an effect with coefficient \beta_j is compensated by
a change of -\beta_j / \beta_k units in the reference effect with
coefficient \beta_k. For a random effect, the coefficient of the median
decider enters the ratio. Mixture models report one compensation per class.
The ratio is computed for every posterior draw, so the reported uncertainty
is the posterior uncertainty of the ratio. Compensations are free of the
utility scale normalization, which makes them comparable across models.
Marginal effects are derivatives of choice probabilities and are computed by finite differences of the predicted probabilities. Marginal effects of a mixed model refer to the population distribution of the random coefficients.
type = "ame" averages the marginal effects over all observed choices.
type = "mea" builds one artificial choice occasion whose covariates are
the averages of the observed ones: the mean for numeric covariates and the
most frequent value for the others. The argument at can be used to replace
the average of the covariates.
### travel mode choice where travel time has an alternative-specific effect
data("TravelMode", package = "AER")
TravelMode$choice <- TravelMode$choice == "yes"
TravelMode$vcost <- TravelMode$vcost / 1.6196 # cost in Euro
set.seed(1)
model <- fit(
choice ~ vcost | 1 | travel,
data = TravelMode,
format = "long",
column_decider = "individual",
column_alternative = "mode",
scale = c(vcost = -1),
iterations = 100,
chains = 1
)
### travel time must be compensated far more in the plane than in the bus
interpret(
model, type = "compensation", effects = c("travel_bus", "travel_air")
)
### the marginal effects at the average covariates, and for a short flight
interpret(model, type = "mea", at = c(travel_air = 40))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.