Hi all, sorry if this has been asked before, I couldn't find any reference to this issue. Also, I can't share any of my data for confidentially reasons (sorry!) I can tell you I have just over 7 million observations of individuals from a census. I am using the most recent updated version of Stata 18.
THE SETUP: I am running a large Mincer regression with many interactions. The idea is to control for race, immigration status, sex, and their interaction terms
I then use margins and marginsplot to display predicted log_income on the y-axis and either log_yrs_school or log_experience on the x-axis. I create multiple figures that have only two series: immigrant vs. non-immigrants for each race-sex cohort (ie, black female immigrants vs. black female non-immigrants or white male immigrants v. white male non-immigrants). Currently, I've done this using " if" commands in a loop:
THE ISSUE: If I run the same regressions and then run margins without the if command, I get different predicted values. Any thoughts/advice would be very much appreciated!
Thanks in advance!
Jerome
THE SETUP: I am running a large Mincer regression with many interactions. The idea is to control for race, immigration status, sex, and their interaction terms
Code:
#delimit ; reg log_income c.log_yrs_school##i.black##i.immigrant##i.female c.log_experience##i.black##i.immigrant##i.female c.log__experience_sqrd##i.black##i.immigrant##i.female if age > 15 ;
Code:
foreach VAR in yrs_school experience{ forvalues FEMALE = 0/1{ forvalues BLACK = 0/1{ margins black#female#immigrant if black == `BLACK' & female == `FEMALE', at(log`VAR'=(``VAR'logs') ) maringsplot, name(`VAR'_f`FEMALE'_,b`BLACK',replace) } } }
Thanks in advance!
Jerome
Comment