Announcement

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

  • Adding lines at 95% CI to kdensity plot

    Hi all,

    I want to add red lines at the 95% confidence interval (one on each side) in this kdensity plot. My code is below. Could you help with this?

    Code:
    preserve
    set seed 692525
    tempfile temp3  // to hold the results from each repetition
    permute beta1 b3 = _b[beta1], saving(`temp3') reps(1000):reghdfe inad_hous beta1 gender2 race2 age_at_refer if ym>=`=tm(2018m12)', absorb(i.hh_zip2 i.yearmonth)
    use `temp3', clear
    kdensity b3, lwidth(0.3) lcolor(cranberry) xline(-0.005, lwidth(0.3) lcolor(ebblue) lpattern(longdash)) xtitle(Estimated Placebo Betas) ytitle(Density) title(Inadequate Housing Allegations) graphregion(color(white)) bgcolor(white) text(100 0.007 "Actual Beta = -0.005", size(small))
    graph export "placebo3.png", as (png) replace
    restore

  • #2
    any ideas on how to do this? I am not quite sure...

    Comment


    • #3
      Nick helped me figure this out on another thread! Thanks everyone!

      Comment


      • #4
        Cross-reference if interested https://www.statalist.org/forums/for...and-bottom-2-5

        Comment

        Working...
        X