Announcement

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

  • How to plot the same coefficient with ci over time (months).

    How to plot the same coefficient with ci over time (months). I have panel data (long format),


    aa: indivicual ID
    month : 1-35
    treated_home = 1:the ones that work from home during Covid, and 0: otherwise

    I want on x axis the months 1,2,3,4...35 and on the yaxis the ln_productivity estimated coeff with its ci.

    I use the following script but it doesn't work:

    forvalues i = 1/35 {
    reg ln_productivity_time i.treated_home if month == `i' , cluster(aa)
    estimates store month`i'
    local allmonths `allmonths' month`i' ||
    local labels `labels' `i'
    }


    display "`allmonths'"
    display `"`labels'"'

    coefplot `allmonths', keep(*.treated_home) drop(_cons) vertical xline(0) bycoefs bylabels(`labels')


    Please help
Working...
X