Announcement

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

  • univar

    How can I add univar on my stata? Here is example from UCLA but when I try with my dataset, it does not pop up this command " univar"

    Stata provides the summarize command which allows you to see the mean and the standard deviation, but it does not provide the five number summary (min, q25, median, q75, max). You can use the detail option, but then you get a page of output for every variable. If you want to get the mean, standard deviation, and five number summary on one line, then you want to get the univar command. The univar command was written by John R. Gleason and appears in the Stata Technical Bulletin #51. You can download univar from within Stata by typing findit univar (see How can I used the findit command to search for programs and get additional help? for more information about using findit).

    Let's illustrate use of the univar command using the high school and beyond data file we use in our Stata Classes.

    use http://www.ats.ucla.edu/stat/stata/notes/hsb1, clear (highschool and beyond (200 cases))
    Here you see the output you get from summarize.

    summarize read write math science socst Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- read | 200 52.23 10.25294 28 76 write | 200 52.775 9.478586 31 67 math | 200 52.645 9.368448 33 75 science | 195 51.66154 9.866026 26 74 socst | 200 52.405 10.73579 26 71
    Here is the output you can get from univar.

    univar read write math science socst -------------- Quantiles -------------- Variable n Mean S.D. Min .25 Mdn .75 Max ------------------------------------------------------------------------------- read 200 52.23 10.25 28.00 44.00 50.00 60.00 76.00 write 200 52.78 9.48 31.00 45.50 54.00 60.00 67.00 math 200 52.64 9.37 33.00 45.00 52.00 59.00 75.00 science 195 51.66 9.87 26.00 44.00 53.00 58.00 74.00 socst 200 52.40 10.74 26.00 46.00 52.00 61.00 71.00 -------------------------------------------------------------------------------

  • #2
    in the future please use the "code" delimiters so that things are readable

    use "search univar" to find the program (it will be low down in the output) and download it

    Comment


    • #3
      Rich Goldstein - The results of the search turn up univar down near the bottom, and an update to it near the top, but not clearly identified as such.

      sg67_1 from http://www.stata.com/stb/stb51
      univar from http://fmwww.bc.edu/RePEc/bocode/u

      The two have the same author but do not appear to be the same version - the "click here to install" links point to two apparently different installations. I'm in over my head - any ideas which is preferred?

      Comment


      • #4
        sorry, no; I have not installed it myself nor ever used it

        Comment


        • #5
          After downloading both packages and comparing them, I find that the univar "low in the output" of search univar is version 1.1.2, while the update higher in the output is version 1.1.3.

          I would be glad to hear, from anybody with more experience than I have, an explanation of why two versions of the same command are available, with the most recent version the least obvious in the search output, and how the user can ensure installation of the latest version. I note especially that if the older package is initially installed, the update all command does not replace it with the later version, presumably because the later version is in a different location with a different package name, although the same ado file name.

          Muhammad Latif Here is my log of installing the latest version of the univar command:
          Code:
          . net install sg67_1.pkg
          checking sg67_1 consistency and verifying not already installed...
          installing into /Users/lisowskiw/Library/Application Support/Stata/ado/plus/...
          installation complete.
          In case you need to, here is my log of uninstalling it:
          Code:
          . ado uninstall sg67_1
          
          package sg67_1 from http://www.stata.com/stb/stb51
                STB-51 sg67_1.  Update to univar.
          
          (package uninstalled)

          Comment

          Working...
          X