Announcement

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

  • Plotting sum of coefficients with confidence intervals in Stata

    Hi,

    I am running the following regression :

    Code:
     areg Prop_60_above Acad_year2  Acad_year3 Acad_year4 [pw = Students_2015] , abs(School_Code) vce(cluster District)
    I want to plot the value of the y variable (and not the coefficients) for each of the four years with confidence intervals. How can this be done in Stata. Thanks.


  • #2
    If I am correct in assuming that the variables Acad_year2, Acad_year3, and Acad_year4 are each 0/1 variables indicating the second, third, and fourth of four academic years, respectively, then what you need to do is get rid of those variables, replace them with a single variable, let's call it academic_year, that ranges from 1 to 4, and re-run the regression as:
    Code:
    areg Prop_60_above i.academic_year [pw = Students_2015], abs(School_code) vce(cluster District)
    and then run
    Code:
    margins academic_year
    marginsplot

    Comment


    • #3
      Thanks a lot. This is perfect!

      Comment

      Working...
      X