Announcement

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

  • Coefplot error

    Hello statusers,

    I'm currently trying to plot the coefficients of a loop of regressions with the aim of creating an event study by cohort. Firstly I create the dummies for each cohort then I run the regressions and save the coefficients.

    Code:
    global controls i.ethnicity i.religion i.rural i.cohort i.commune2 newschool_10km
    
    foreach i of numlist 76/85 90/99 {
    gen cohort`i'=1 if cohort==19`i' & treatment_cohort!=.
    replace cohort`i'=0 if cohort`i'==. & treatment_cohort!=.
    gen inter_cohort`i'= cohort`i'*c.newschool_10km
    }
    
    global $inter_cohort inter_cohort76 inter_cohort77 inter_cohort78 inter_cohort79 inter_cohort80 inter_cohort81 inter_cohort82 inter_cohort83 inter_cohort84 inter_cohort85 inter_cohort90 inter_cohort91 inter_cohort92 inter_cohort93 inter_cohort94 inter_cohort95 inter_cohort96 inter_cohort97 inter_cohort98 inter_cohort99
    
    reg mdschoolattaind $inter_cohort $controls, vce(cluster id_geo)
    estadd ysumm
    est store c_mdschoolattaind
    
    coefplot c_mdschoolattaind, vertical keep($inter_cohort ) yline(0) xtitle("Cohort", size(small)) ytitle("Effect of", size(small)) xlabel(, labsize(vsmall)) ylabel(, labsize(small)) graphregion(color(white))
    graph save coefplot, replace
    But it spots the following error:

    Code:
    strmatch():  3200  conformability error
         coefplot_keepdrop():     -  function returned error
                     <istmt>:     -  function returned error
    Any idea on why this happens? Thanks in advance!

    Daniel.
Working...
X