Announcement

Collapse
No announcement yet.
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    I have a very simple request: could you please add an option [, rsort] that does a reverse (ascending) sort on frequency as opposed to just the descending sort? Myself (and coworkers) get annoyed with constantly having to scroll up to see the most frequent tabulations when there are more than 20 or so values of a variable.

    Comment


    • #47
      Originally posted by Carl Isaac View Post
      I have a very simple request: could you please add an option [, rsort] that does a reverse (ascending) sort on frequency as opposed to just the descending sort? Myself (and coworkers) get annoyed with constantly having to scroll up to see the most frequent tabulations when there are more than 20 or so values of a variable.
      Sounds like a good suggestion. While waiting for it to be implemented, you might want to download and install Ben Jann's fre program. I usually prefer it over the tab1 command because of all the nice features and options it has. Example:

      Code:
      . webuse auto, clear
      (1978 automobile data)
      
      . tab1 rep78, sort
      
      -> tabulation of rep78  
      
           Repair |
      record 1978 |      Freq.     Percent        Cum.
      ------------+-----------------------------------
                3 |         30       43.48       43.48
                4 |         18       26.09       69.57
                5 |         11       15.94       85.51
                2 |          8       11.59       97.10
                1 |          2        2.90      100.00
      ------------+-----------------------------------
            Total |         69      100.00
      
      . fre rep78, descending
      
      rep78 -- Repair record 1978
      -----------------------------------------------------------
                    |      Freq.    Percent      Valid       Cum.
      --------------+--------------------------------------------
      Valid   3     |         30      40.54      43.48      43.48
              4     |         18      24.32      26.09      69.57
              5     |         11      14.86      15.94      85.51
              2     |          8      10.81      11.59      97.10
              1     |          2       2.70       2.90     100.00
              Total |         69      93.24     100.00           
      Missing .     |          5       6.76                      
      Total         |         74     100.00                      
      -----------------------------------------------------------
      
      . fre rep78, ascending
      
      rep78 -- Repair record 1978
      -----------------------------------------------------------
                    |      Freq.    Percent      Valid       Cum.
      --------------+--------------------------------------------
      Valid   1     |          2       2.70       2.90       2.90
              2     |          8      10.81      11.59      14.49
              5     |         11      14.86      15.94      30.43
              4     |         18      24.32      26.09      56.52
              3     |         30      40.54      43.48     100.00
              Total |         69      93.24     100.00           
      Missing .     |          5       6.76                      
      Total         |         74     100.00                      
      -----------------------------------------------------------
      
      .
      Type ssc describe fre for more info on the command.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://academicweb.nd.edu/~rwilliam/

      Comment


      • #48
        #46 is naturally a request to StataCorp but while you're waiting groups from the Stata Journal has an option order(high) / order(low) to control sort order.

        Code:
        . search st0496, entry
        
        Search of official help files, FAQs, Examples, and Stata Journals
        
        SJ-18-1 st0496_1  . . . . . . . . . . . . . . . . . Software update for groups
                (help groups if installed)  . . . . . . . . . . . . . . . .  N. J. Cox
                Q1/18   SJ 18(1):291
                groups exited with an error message if weights were specified;
                this has been corrected
        
        SJ-17-3 st0496  . . . . .  Speaking Stata: Tables as lists: The groups command
                (help groups if installed)  . . . . . . . . . . . . . . . .  N. J. Cox
                Q3/17   SJ 17(3):760--773
                presents command for listing group frequencies and percents and
                cumulations thereof; for various subsetting and ordering by
                frequencies, percents, and so on; for reordering of columns;
                and for saving tabulated data to new datasets
        As above the entry st0496 is an unpredictable shortcut to finding download linke, given the mischief of mine in using a common word for the name of the command. That is, a search using the word groups finds much more than you want here.

        Comment


        • #49
          A request to allow importing pdf text into Stata (doesnt have to be neatly imported). One of the many use cases is of importing a PDF questionnaire of Survey Solutions which can be handy to make a data set which indicates each variables enabling condition, along with page number, answer choices etc. for analysis purposes.

          Comment


          • #50
            Add an offset option in twoway bar command. This will solve overlap problem when several quantities are observed at the same distinct categories or a series of times. If twoway bar has same mechanism with graph bar, there will be no necessary for using transparency or opacity to make the overlap clear. (By the way, bargap() in graph bar and barwidth() in twoway bar are confusing every so often.)

            Overlaying twoway bar graphs - bars side-by-side not overlaid

            Changing a density figure to get bars side by side instead of overlaying one another

            side_histogram available from SSC

            Comment


            • #51
              Originally posted by Tommy Morgan View Post
              Allow/create a few fill patterns for graphs!
              Ironically, there was this in ancient times of Stata.

              How can I create a pie or bar chart containing categorical data?

              Click image for larger version

Name:	bar3.gif
Views:	1
Size:	24.9 KB
ID:	1780834

              Comment

              Working...
              X