Ploting marginal effect of a continuous variable interacting with a spline.


New Member
Dear Talk Stats users,
Before going to the core of my problem, let me sum up what I've been doing and Why.
I am interested in the potential long term effect of bad economic conditions when young graduates enter the labor market on the selection into public sector in France.
Thereby, I built a pseudo-panel of young graduate cohorts (a cohort being defined by year of graduation x sex x having more than a high school degree or not).
Each cohort is observed for 15 years after graduation.
My main coefficients of interest are the 15-25 unemployment rate at graduation and its interaction with a linear spline of potential experience.
If it is not clear I use Stata.
I generate the spline using the command :
mkspline exp4 4 exp7 7 exp10 10 exp33up= potexp, marginal

the regression then looks like :
reg y c.UR##(c.exp4 c.exp7 c.exp10 c.exp33up) schooling sex##upedu yi*, vce(cluster edcohortid)

I want to plot the marginal effect (and confidence interval) of UR for several value of potential experience (potexp) for which I allow 3 trend breaks.
When I use the margin command, Stata compute the marginal effect for all possible combinations of the trends
(for instance if I do :
margins, dydx(UR) continuous at( exp4=(1 4 7 10 15) exp7=( 0 3 6 11 ) exp10=( 0 3 8) exp33up=( 0 5)), I get 120 marginal effects although I need basically 5 points for only these combinations :

exp4 1 4 7 10 15
exp7 0 0 3 6 11
exp10 0 0 0 3 8
exp33up 0 0 0 0 5

Does anyone know how to do it ?

What I want is pretty much like those in this paper (page 26 for instance)

Thank you for your help !