I'm using MEM and getting a weird result, so I think I'm doing something wrong. The Stata version is 14.2 on Windows 10.
I'm using a dataset of 32 variables and 800,000~ observations. 3 Variables are used in the question below. An example:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float action_num byte(officer_race_num driver_race_num) 2 1 1 2 0 0 2 0 0 2 0 0 1 0 1 2 0 0 2 0 0 1 2 2 2 1 1 1 0 1 2 0 0 3 1 1 1 0 0 1 0 2 1 0 1 1 1 1 2 0 0 1 0 0 2 0 0 1 0 1 end
Code:
mlogit action_num i.officer_race_num i.driver_race_num i.officer_race_num#i.driver_race_num i.year, r base(1)
Code:
margins, dydx (i.officer_race_num) atmeans post
Meaning, the change is I changed the above mlogit command to:
Code:
gen off_drv_race = 0 replace off_drv_race = 1 if officer_race_num==1 & driver_race_num==1 replace off_drv_race = 2 if officer_race_num==1 & driver_race_num==2 replace off_drv_race = 3 if officer_race_num==1 & driver_race_num==3 replace off_drv_race = 4 if officer_race_num==2 & driver_race_num==1 replace off_drv_race = 5 if officer_race_num==2 & driver_race_num==2 replace off_drv_race = 6 if officer_race_num==2 & driver_race_num==3 mlogit action_num i.officer_race_num i.driver_race_num i.off_drv_race i.year, r base(1)
The problem: I want to post the margins for the interactions, and to do this I need to use the manual interaction since margins can't intake the Stata induced interaction ("#"), but I see it changes the initial results. So I think maybe I'm making some mistake along the way.
I checked if the mlogit results were different, but they are the same with the manual interaction and with the Stata induced interaction ("#").
So my main question would be, why is there a difference? And what does this difference mean? What am I doing wrong?
Thanks alot,
Dor.
0 Response to A problem with interaction in mlogit and marginal effects at means
Post a Comment