Hi R users,
I use effects() to compute the marginal effects of a mlogit model in R.
"...the effect is a ratio of two marginal variations of the probability and of the covariate; these variations can be absolute "a" or relative "r". This argument is
a string that contains two letters, the first refers to the probability, the second to
the covariate"
Here is the R demo example:
Best regards,
Thomas
I use effects() to compute the marginal effects of a mlogit model in R.
Code:
effects(object, covariate = NULL, type = c("aa", "ar", "rr", "ra"), data = NULL,...)
- Which type ("rr", "aa", "ar", "ra") in effects() should I use when estimating the marginal effects?
- How do I interpret the different types?
"...the effect is a ratio of two marginal variations of the probability and of the covariate; these variations can be absolute "a" or relative "r". This argument is
a string that contains two letters, the first refers to the probability, the second to
the covariate"
Here is the R demo example:
Code:
data("Fishing", package = "mlogit")
Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode")
m <- mlogit(mode ~ price | income | catch, data = Fish)
# compute a data.frame containing the mean value of the covariates in
# the sample
z <- with(Fish, data.frame(price = tapply(price, index(m)$alt, mean),
catch = tapply(catch, index(m)$alt, mean),
income = mean(income)))
# compute the marginal effects (the second one is an elasticity
effects(m, covariate = "income", data = z)
effects(m, covariate = "price", type = "rr", data = z)
effects(m, covariate = "catch", type = "ar", data = z)
Thomas