I'm trying to use a McFadden's choice model using cmclogit with case- and alternative-specific variables. I'm interested in examining how the average marginal effect of an alternative-specific variable varies across alternatives.
Here's an example for the basic main effects model (with time being the alternative-specific variable, and mode the alternative-id)
Code:
use https://www.stata-press.com/data/r16/travel, clear cmset id mode // setup case-id and alternative-id gen time=traveltime+termtime * main effects cmclogit-model cmclogit choice time , casevars(income partysize)
Code:
margins, dydx(time) marginsplot
In other words, wouldn't I need the following model instead of the main effects model:
Code:
cmclogit choice time c.time#i.mode, casevars(income partysize)
Any help in getting me out of my confusion is greatly appreciated!
Best,
Irene
0 Response to cmclogit + margins + interactions
Post a Comment