Announcement

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

  • Ordering table by percent "yes"

    I'm pretty new to STATA and this is probably a silly question, but I can't seem to find the answer anywhere and have been playing with it for a while.

    I have geographic zones where surveys were completed. I was able to sort my table by zone, but I want to sort it so that the ones with the highest percent of "Yes" responses come first. I essentially want to summarize which zones were the most responsive. You can view my table below.

    Further, if you have advice on how to better present the most responsive zones in a succinct table, I would love the input
    Thanks

    tab zone revsurveycompleted, row

    +----------------+
    | Key |
    |----------------|
    | frequency |
    | row percentage |
    +----------------+

    | Survey completed
    Zone | Yes Missing | Total
    -----------+----------------------+----------
    1 | 3 6 | 9
    | 33.33 66.67 | 100.00
    -----------+----------------------+----------
    2 | 4 12 | 16
    | 25.00 75.00 | 100.00
    -----------+----------------------+----------
    3 | 2 21 | 23
    | 8.70 91.30 | 100.00
    Last edited by Keila Pieters; 15 Feb 2019, 10:29. Reason: sorting

  • #2
    You may wish to try something like:

    Code:
    tab zone revsurveycompleted, row colsort
    tab zone revsurveycompleted, row rowsort
    Last edited by Marcos Almeida; 15 Feb 2019, 10:44.
    Best regards,

    Marcos

    Comment


    • #3
      You don't give a data example (please read and follow FAQ Advice #12) so it's hard to give a decent code example. But sometimes it is easiest to create a reduced dataset with collapse or contract and then just sort as desired.

      Comment

      Working...
      X