Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

effects.mlogit

Marginal effects of the covariates


Description

The effects method for mlogit objects computes the marginal effects of the selected covariate on the probabilities of choosing the alternatives

Usage

## S3 method for class 'mlogit'
effects(
  object,
  covariate = NULL,
  type = c("aa", "ar", "rr", "ra"),
  data = NULL,
  ...
)

Arguments

object

a mlogit object,

covariate

the name of the covariate for which the effect should be computed,

type

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,

data

a data.frame containing the values for which the effects should be calculated. The number of lines of this data.frame should be equal to the number of alternatives,

...

further arguments.

Value

If the covariate is alternative specific, a J \times J matrix is returned, J being the number of alternatives. Each line contains the marginal effects of the covariate of one alternative on the probability to choose any alternative. If the covariate is individual specific, a vector of length J is returned.

Author(s)

Yves Croissant

See Also

mlogit() for the estimation of multinomial logit models.

Examples

data("Fishing", package = "mlogit")
library("zoo")
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, idx(m, 2), mean),
                           catch = tapply(catch, idx(m, 2), mean),
                           income = mean(income)))
# compute the marginal effects (the second one is an elasticity
## IGNORE_RDIFF_BEGIN
effects(m, covariate = "income", data = z)
## IGNORE_RDIFF_END
effects(m, covariate = "price", type = "rr", data = z)
effects(m, covariate = "catch", type = "ar", data = z)

mlogit

Multinomial Logit Models

v1.1-1
GPL (>= 2)
Authors
Yves Croissant [aut, cre]
Initial release
2020-10-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.