Announcement

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

  • Ventiles

    Hello,

    I want to take a variable of mine, put it into ventiles, then use collapse to graph the means in each ventile. Can you help with this? I tried with the sumdist command but something isn't working quite right.
    Thanks!

  • #2
    Something along these lines?

    Code:
    clear
    set obs 100
    gen var = runiformint(0,100)
    //starting here
    xtile ventiles = var,nquantiles(20)
    collapse (mean) var,by(ventiles)

    Comment


    • #3
      On the face of it xtile should get you started.

      sumdist is from SSC. It's hard to comment on what you did without seeing code and/or an error message or story on what happened precisely.

      Comment

      Working...
      X