Given the data below, I am trying to figure out how I can get a table/summarized data that tabulates the number of times the variable value occurs as 1/"Observed" and the number of times value occurs as 0/"Not Observed" for each level of the variable metric, and then can sort the result in descending order. Essentially, I want to find out which metrics are "Not Observed" most frequently (top 3 or 5) and which metrics are "Observed" most frequently. There are 21 levels of metric in my full data set. I can use -table- or -tabstat- to get the frequencies, but I can't figure out how I can sort any of that output by frequency for "Observed" or "Not Observed" (I realize I would have to sort for each separately). What can I use to achieve the output I want?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float observe_num str23 metric byte value 1 "classmanage1" 1 1 "classmanage2" 1 1 "classmanage3" 1 1 "classmanage4" 0 1 "general1" 1 1 "general2" 1 1 "general3" 1 1 "general4" 1 1 "general5" 1 1 "letterwordworkoptional1" 1 1 "letterwordworkoptional2" 1 1 "phonicwordswork" 1 1 "readingnewbook1" 0 1 "readingnewbook2" 0 1 "readingnewbook3" 0 end label values value observe label def observe 0 "Not Observed", modify label def observe 1 "Observed", modify
Comment