# st: -graph twoway (function ...)- question

 From Andrea Bennett To statalist@hsphsun2.harvard.edu Subject st: -graph twoway (function ...)- question Date Thu, 24 Jul 2008 11:28:51 +0200

Dear all,

I have estimated average marginal effects from a probit regression with -margeff- and would like to generate a graph which plots the marginal effects for 3 age categories (dummies) dependent on a continuous variable called cont.

The model is as such:

y = b0 + b1*age2 + b2*age3 + b3*age2*cont +b4*age3*cont + b5*cont + controls

As age2 and age3 are dummies, would the following graph command be correct:

twoway (function age1 = _b[cont]*x, range(0 0.5)) (function age2 = _b[age2] + (_b[cont] + _b[cont_age2])*x, range(0 0.5)) (function age3 = _b[age3] + (_b[cont] + _b[cont_age3])*x, range(0 0.5))

The way I understand it, since I have now marginal effects I can work equivalently to linear models. Then the above graph should be correct, right? Further, this would also be correct when introducing other interactions with -cont- as long as I am looking at the marginal effects of age groups when -cont- changes?