Announcement

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

  • How do I make a line graph in STATA where I have to graph the means of different variables along the same x-axis?

    I have done all sorts of things (looked into egen and collapse, but I am not avail myself of either of those commands).
    There are about 21,000 observations in my data set, each has either treatment = 1 or =0 and values for earnings in the 30 follow-up periods following administering the treatment to the treatment group. These period-wise earnings are different variables in and of themselves. In other words, there is a variable for Period 1's earnings, another variable for Period 2's earnings, another variable for Period 3's earnings, etc. etc.
    What I need to do is get the averages of each period's earnings, separately for the two different values of treatment and graph them on the same graph. My final output would be a line graph of two different lines, one of treatment = 1 and the other of treatment = 0, of the averages from these periods. It would be 2 X 30-observation series.

  • #2
    There is no data example here (do please read and act on FAQ Advice #12), but I'd suggest that for this and anything similar it is easiest first to reshape long.

    Comment

    Working...
    X