Announcement

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

  • Adding labels in binscatter

    Hi everyone,

    I would like, instead of my variable name, for the variable value to be what is on the Y-axis. Can you help? I put some code below. I tried adding labels, ylabel(labels) and some other things but they didn't work and I can't seem to find on google how to do this with binscatter. THanks!

    Code:
    binscatter `v' poolednormscore if sample==1, nq(20) line(lfit) rd(0)
        graph export "C:\Users\lib18002\Dropbox\AFST\output\analysis\1ststage\ `v'_balance.png", as(png) replace

  • #2
    This references Michael Stepner's -binscatter- (ssc desc binscatter).

    You can store the variable labels as macros and then pass them to -binscatter-.
    Code:
    sysuse auto, clear
    local ytitle: variable label mpg
    local xtitle: variable label price
    binscatter mpg price, ytitle(`ytitle') xtitle(`xtitle')

    Comment

    Working...
    X