Announcement

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

  • How to do a special histogram like this in Stata?

    Hello, I saw a histogram by group like below.
    I want to use the classical Stata data auto.dta to mimic it. (categorical variables-rep78, foreign; continuous-any variable in the dataset except for make and these two variables).
    Can someone help me in Stata code?

    webuse auto,clear
    Click image for larger version

Name:	histogram .png
Views:	1
Size:	43.8 KB
ID:	1665422


  • #2
    I see two variables there. not three.

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . graph bar (percent), over(rep78) by(foreign) blabel(total, format(%1.0f))
    Last edited by Nick Cox; 19 May 2022, 18:43.

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X