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.
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.
Here you see the output you get from summarize.
use http://www.ats.ucla.edu/stat/stata/notes/hsb1, clear (highschool and beyond (200 cases))
Here is the output you can get from univar.
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
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 -------------------------------------------------------------------------------
Comment