Hi everybody

I am researching how outsourcing affects employees in terms of income, employment, and benefits and, next, how these effects are moderated by gender and education.

Now, I have made all my models and want to visualize them using margins. For the sake of brevity, I have used a loop:

Code:
*gender
foreach var of varlist income employment benefits {
    xtreg `var' i.treatment##i.time##i.gender i.education covariates, fe cluster(id)
    
    margins treatment, at(time=(1999 2000 2001 2002) gender = (0))
    marginsplot, name(male_`var', replace) different options
    
    margins treatment, at(time=(1999 2000 2001 2002) gender = (1))
    marginsplot, name(female_`var', replace) different options

}

foreach var of varlist income employment benefits {
grc1leg male_`var' female_`var', ycommon name(gender_`var')
 }

foreach var of varlist income employment benefits {
graph display gender_`var'
graph export gender_`var'.pdf, replace
 } 
 


**********************************************************
*education
foreach var of varlist income employment benefits {
    xtreg `var' i.treatment##i.time##i.education i.gender covariates, fe cluster(id)
    
    margins treatment, at(time=(1999 2000 2001 2002) education = (0))
    marginsplot, name(edu0_`var', replace) different options
    
    margins treatment, at(time=(1999 2000 2001 2002) education = (1))
    marginsplot, name(edu1_`var', replace) different options
}

foreach var of varlist income employment benefits {
grc1leg edu0_`var' edu1_`var', ycommon name(edu_`var')
 }

foreach var of varlist income employment benefits {
graph display edu_`var'
graph export edu_`var'.pdf, replace
 }
However, I want to use the same y-axis for the analyses of the different outcomes so that, e.g., income has the same y-axis through the main analysis, gender analysis, and education analysis (e.g. 40.000, 42.500, 45.000, 47.500, 50.000).

Is there a way to do this in the regression loop or afterwards? What I do not want is to stop using the loop and do everything manually. I hope somebody has a suggestion.


Best,
Gustav