Hi everyone,
can someone explain how to calculate the marginal effects of a multinomial logit model with alternative-invariant variables (e.g. income) only. A similar question was asked here but not answered sufficiently. The calculation works only, if I also include alternative-variant variables (e.g. catch rate and price). See mlogit standard example:
Example including alternative-invariant and -variant variables (works):
It does not work, if I include "income" only.
Example including alternative-variant variables only (does not work)
Does someone know how to specify the z2 function?
Best regards
Thomas
can someone explain how to calculate the marginal effects of a multinomial logit model with alternative-invariant variables (e.g. income) only. A similar question was asked here but not answered sufficiently. The calculation works only, if I also include alternative-variant variables (e.g. catch rate and price). See mlogit standard example:
Example including alternative-invariant and -variant variables (works):
Code:
data("Fishing", package = "mlogit")
Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode")
m1 <- mlogit(mode ~ price | income | catch, data = Fish)
z1 <- with(Fish, data.frame(price = tapply(price, index(m1)$alt, mean),
catch = tapply(catch, index(m1)$alt, mean),
income = mean(income)))
effects(m1, covariate = "income", data = z1)
Example including alternative-variant variables only (does not work)
Code:
m2 <- mlogit(mode ~ 0 | income, data = Fish)
z2 <- ??? # I think this is the problem to calculate
effects(m2, covariate = "income", data = z2)
Best regards
Thomas
Last edited: