Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: question on graphing

 From Duha Altindag To statalist@hsphsun2.harvard.edu Subject Re: st: question on graphing Date Mon, 4 Apr 2011 12:09:06 -0500

You need the coefficient of age.

**begin
regress lahe age female bachelor
preserve
g y=_b[age]*age
duplicates drop age,force
sort age
line y age
restore
*for men & women separately:

preserve
g y_men=_b[age]*age
g y_women=_b[age]*age+female
duplicates drop age female,force
sort age
twoway (line y_men age) (line y_women age)
restore
**end

If you want different slopes for men and women, you should regress
wage on age, female and the interaction of age and female though.

On Mon, Apr 4, 2011 at 11:54 AM, Averett, Susan L
<averetts@lafayette.edu> wrote:
>
> Hi, I am running a regression with logearnings as the dependent variable and age in  years, a female dummy variable and a dummy equal to 1 if the individual has a college degree. I would like to graph my age/earnings profile in Stata...i.e. I'd like to graph the relationship between predicted logearnings and age holding the other variables constant but I cannot figure out how to do this. I'd also then like to plot the lines separately for men and women on the same graph.
> Any suggestions?
>
> Here is my regression:
>
> regress lahe age female bachelor
>
> Susan Averett
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/