Announcement

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

  • command for this graph

    Hi everyone,

    I've just started out with stata and im trying to visualise the relationship between age and pay. Iw Ould like to make a graph like attached, but cannot find the command. Could someone help me?

    Thank you!
    Attached Files

  • #2
    Code:
    webuse nlswork, clear
    xtset idcode year
    xtreg ln_wage tenure union i.age, fe
    margins, at(age=(20(2)40))
    marginsplot
    Res.:

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	27.9 KB
ID:	1655492

    Comment


    • #3
      HI Andrew, Thank you so much for your reply!
      When trying to imitate your commands, Stata returns that my categorical age variable is omitted because of collinearity. Do you know why that could be the case?

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        Code:
        webuse nlswork, clear
        xtset idcode year
        xtreg ln_wage tenure union i.age, fe
        margins, at(age=(20(2)40))
        marginsplot
        Res.:

        [ATTACH=CONFIG]n1655492[/ATTACH]
        I forgot to quote you, So I'm not sure whether you would get a notification from my message hope this helps

        Comment


        • #5
          Can you show your commands and if possible, post a data example that replicates this? If you include time effects in the model and have an age variable that coincides with time (e.g., in a panel of firms, all firms were founded at the start of the sample period), then the age indicators will be omitted as they are exactly collinear with the time effects. In your case, this does not look likely, but we will need more information to advise you.

          Comment


          • #6
            Originally posted by Andrew Musau View Post
            Can you show your commands and if possible, post a data example that replicates this? If you include time effects in the model and have an age variable that coincides with time (e.g., in a panel of firms, all firms were founded at the start of the sample period), then the age indicators will be omitted as they are exactly collinear with the time effects. In your case, this does not look likely, but we will need more information to advise you.
            I did it!! I managed last night thank you so much for your help!!!

            Comment

            Working...
            X