Announcement

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

  • -des2- updated on SSC

    Thanks as always to Kit Baum, an updated version of des2 is now available from the SSC.

    In Stata use the ssc command (or adoupdate if you already have des2 installed).

    des2 is a 'hybrid' combining describe and lookfor with clickable output. It is thought as a convenience tool for interactive use when exploring new datasets.

    Best
    Daniel

  • #2
    Daniel,

    I wasn't familiar with des2 but it sounds like extremely useful compoent. I installed it and it's working fine. If I can make one comment, presumably the default option to tabulate could be replaced with summarise for variables with too many values. I applied the des2 on the data set that I used to work on and go too many values error on a couple of occasions. Understandably, tabulating some of those variables would make no sense but presumably the output from summarize command could be returned instead of an error message. I would hypothesise that tabulating with more than 50 distinct values is not immediately readable so maybe the program could return summarizeoutput when faced with such a variable?
    Kind regards,
    Konrad
    Version: Stata/IC 13.1

    Comment


    • #3
      Konrad would like to see summary statistics for variables that have more than 50 distinct values, instead of tabulating them. He can achieve this typing

      Code:
      des2 ,cmd(summarize) tabvalues(50) set
      The set option tells des2 to 'remember' the other options (by defining global macros DES2_CMD and DES2_TABVALUES), so Konrad does not need to specify these options repeatedly. Konrad probably wants to add an strcmd() option, so string variables will not be summarized.

      There was one version of des2 with similar default behavior (not on SSC, though). However, determining the number of distinct values of a variable and setting the respective command turns out to require (quite some) time, because des2 needs to tabulate each variable internally. I therefore decided this should be optional rather than default behavior. If specified, the tabvalues() option will slow down execution time.


      I am currently thinking about two ways of improving des2 in this respect.

      First, I will consider some way for des2 to 'remember' which command to execute for which variable, once this has been determined. This could be accomplished by defining variable characteristics that hold the specific command to be executed. Of course the user would have to request such behavior, since des2 is not to alter the dataset in any way.

      Second, I am thinking about an alternative output. Below each variable there could be an additional line with a number of alternative commands to execute. These could be changed by the user.

      I hope I will find the time to implement these improvements on the weekend.

      Best
      Daniel

      Comment


      • #4
        Daniel,

        Thanks for your reply. Personally, I find that the option with alternative commands would be most user friendly. I understand your point concerning need to tabulate the variables. I'm thinking whether you could maybe make use of the unique (SSC) by Michael Hills and run it on each variables passed to des2? If unique would return results than 50 then des2 would switch to summarise, as a rule thumb. Having said that, I do not know how installing "dependencies" works in SSC.
        Kind regards,
        Konrad
        Version: Stata/IC 13.1

        Comment


        • #5
          Konrad,

          thanks for your comments. I will see what I can do.

          Concerning your suggestion to use unique, I seriously doubt that this (or in fact any) user-written command could ever outperform tabulate in determining the number of unique (better: distinct) values of a variable, though. I have played around with Mata for a short while (which resulted in a fstlvls; short for: fast levelsof), but even this is (much) slower than tabulate.

          Best
          Daniel
          Last edited by daniel klein; 29 Jul 2014, 07:17.

          Comment


          • #6
            Thanks much. I had it but tried to update it and got a version from 2012 using both ssc and adoupdate. Is that correct? Thanks.

            Ric Uslaner

            Comment


            • #7
              Konrad: A user-programmer writing their program to use another user-written program obliges users to download both. There is no problem beyond that.

              In this case I would agree with Daniel: it is much easier and better to use official Stata commands to determine the number of distinct values for his purposes.

              Comment


              • #8
                Thanks much. I had it but tried to update it and got a version from 2012 using both ssc and adoupdate. Is that correct?
                Type

                Code:
                ssc install des2 ,replace
                discard
                which des2
                should give

                Code:
                *! version 3.0.0 26jul2014 Daniel Klein
                Best
                Daniel

                Comment


                • #9
                  Tried that and got:

                  . ssc install des2,replace
                  checking des2 consistency and verifying not already installed...
                  all files already exist and are up to date.

                  . discard

                  . which des2
                  c:\ado\stbplus\d\des2.ado
                  *! version 1.0.2 10mar2012 Daniel Klein

                  Comment


                  • #10
                    I get the same results as Ric. Maybe SSC hasn't actually updated the software yet after all?
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

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

                    Comment


                    • #11
                      It seems based on the files located on the server that only the package file was uploaded yesterday, the rest of the package content remains old (2012).

                      Click image for larger version

Name:	des2.png
Views:	1
Size:	7.2 KB
ID:	110172

                      This should result in behavior where Stata would suggest to update the package, but would install the older version again and not suggest any further updates.

                      Best, Sergiy Radyakin

                      Comment


                      • #12
                        Thanks, once again, to Kit Baum, an updated version of des2 is now available for download from the SSC.

                        Konrad Zdeb asked for a way to execute different commands for different variables. I gave a code example how to do this, which still works. However, I have also sketched two ideas how to deal with his suggestion and both ideas are now implemented.

                        Konrad can now type

                        Code:
                        des2 ,cmdbar
                        to display below each variable a list of commands to be executed when clicked.

                        One problem with the hole approach of des2 has been the necessity to repeatedly scroll back up to the original output, once one or more commands have been executed and the results window filled. Alternatively, one had to call des2 over and over. Of course, clever users have used a log file to record des2's output and bring this file up in the viewer. I was not one of these clever users, by the way, but this is essentially what the new view option mimics. It allows the output to show up in the viewer, so you can explore any number of variables without the need to permanently scroll back up or specify des2 repeatedly.

                        Type

                        Code:
                        des2 ,view
                        and see the (now clickable) examples in the help file (that looks more complicated than the command really is - or so I hope).

                        Best
                        Daniel
                        Last edited by daniel klein; 07 Aug 2014, 10:30.

                        Comment

                        Working...
                        X