Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • What commands to use when plotting quadratic relationship

    I have dependent variable lnhoupay and independent variables age agesqr sex edage. I want to regress theses variables on stata and after that I want to draw implied relationship between lnhoupay and age at average characteristic for other variables. Now I know commands for regressing and plotting quadratic relationship but I don't know how to get an expression which tells me about this as a quadratic relationship between ln(hourpay) and age holding all other variables constant at their mean values. I want to draw quadratic relationship between lnhoupay and age when all other variables are taking values at their mean values. Please tell how is this possible in stata?

  • #2
    Something like this:

    Code:
    regress lnhoupay c.age c.age#c.age sex edage // AND OTHER COVARIATES AS DESIRED
    margins, at(age=(20(5)75)) // OR WHATEVER AGES YOU ARE INTERESTED IN
    marginsplot // ADD OPTIONS TO DECORATE THE GRAPH THE WAY YOU PREFER

    Comment

    Working...
    X