I have the following dataset with observations of volumes (vol) traded by 5967 unique companies.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long permno str10 date byte(shrcd exchcd) str5 ticker str32 comnam long vol float(var1 observations code10_11 total count)
10001 "01/31/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  667 380 1 1 1 1
10001 "02/28/1986" 11 3 "GFGC" "GREAT FALLS GAS CO" 1067 380 1 1 0 1
10001 "03/31/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  335 380 1 1 0 1
10001 "04/30/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  225 380 1 1 0 1
10001 "05/30/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  217 380 1 1 0 1
10001 "06/30/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  238 380 1 1 0 1
10001 "07/31/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  429 380 1 1 0 1
10001 "08/29/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  895 380 1 1 0 1
10001 "09/30/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  366 380 1 1 0 1
10001 "10/31/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  362 380 1 1 0 1
10001 "11/28/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  312 380 1 1 0 1
10001 "12/31/1986" 11 3 "GFGC" "GREAT FALLS GAS CO"  312 380 1 1 0 1
10001 "01/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  399 380 1 1 0 1
10001 "02/27/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  365 380 1 1 0 1
10001 "03/31/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  216 380 1 1 0 1
10001 "04/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  188 380 1 1 0 1
10001 "05/29/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  211 380 1 1 0 1
10001 "06/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  146 380 1 1 0 1
10001 "07/31/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  215 380 1 1 0 1
10001 "08/31/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  314 380 1 1 0 1
10001 "09/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  461 380 1 1 0 1
10001 "10/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  550 380 1 1 0 1
10001 "11/30/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  822 380 1 1 0 1
10001 "12/31/1987" 11 3 "GFGC" "GREAT FALLS GAS CO"  960 380 1 1 0 1
10001 "01/29/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  490 380 1 1 0 1
10001 "02/29/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  382 380 1 1 0 1
10001 "03/31/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  369 380 1 1 0 1
10001 "04/29/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  121 380 1 1 0 1
10001 "05/31/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  102 380 1 1 0 1
10001 "06/30/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  153 380 1 1 0 1
10001 "07/29/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  110 380 1 1 0 1
10001 "08/31/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"   65 380 1 1 0 1
10001 "09/30/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  119 380 1 1 0 1
10001 "10/31/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  212 380 1 1 0 1
10001 "11/30/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  150 380 1 1 0 1
10001 "12/30/1988" 11 3 "GFGC" "GREAT FALLS GAS CO"  108 380 1 1 0 1
10001 "01/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  252 380 1 1 0 1
10001 "02/28/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  417 380 1 1 0 1
10001 "03/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  241 380 1 1 0 1
10001 "04/28/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  310 380 1 1 0 1
10001 "05/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  629 380 1 1 0 1
10001 "06/30/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  200 380 1 1 0 1
10001 "07/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  185 380 1 1 0 1
10001 "08/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  836 380 1 1 0 1
10001 "09/29/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  497 380 1 1 0 1
10001 "10/31/1989" 11 3 "GFGC" "GREAT FALLS GAS CO" 2250 380 1 1 0 1
10001 "11/30/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  411 380 1 1 0 1
10001 "12/29/1989" 11 3 "GFGC" "GREAT FALLS GAS CO"  178 380 1 1 0 1
10001 "01/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  353 380 1 1 0 1
10001 "02/28/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  149 380 1 1 0 1
10001 "03/30/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  127 380 1 1 0 1
10001 "04/30/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  166 380 1 1 0 1
10001 "05/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  279 380 1 1 0 1
10001 "06/29/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  105 380 1 1 0 1
10001 "07/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  194 380 1 1 0 1
10001 "08/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  111 380 1 1 0 1
10001 "09/28/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  123 380 1 1 0 1
10001 "10/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"   64 380 1 1 0 1
10001 "11/30/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  206 380 1 1 0 1
10001 "12/31/1990" 11 3 "GFGC" "GREAT FALLS GAS CO"  106 380 1 1 0 1
10001 "01/31/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  384 380 1 1 0 1
10001 "02/28/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  245 380 1 1 0 1
10001 "03/28/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  124 380 1 1 0 1
10001 "04/30/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  243 380 1 1 0 1
10001 "05/31/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  236 380 1 1 0 1
10001 "06/28/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  255 380 1 1 0 1
10001 "07/31/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  161 380 1 1 0 1
10001 "08/30/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  654 380 1 1 0 1
10001 "09/30/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  542 380 1 1 0 1
10001 "10/31/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  366 380 1 1 0 1
10001 "11/29/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  367 380 1 1 0 1
10001 "12/31/1991" 11 3 "GFGC" "GREAT FALLS GAS CO"  269 380 1 1 0 1
10001 "01/31/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  211 380 1 1 0 1
10001 "02/28/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  405 380 1 1 0 1
10001 "03/31/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  282 380 1 1 0 1
10001 "04/30/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  119 380 1 1 0 1
10001 "05/29/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  137 380 1 1 0 1
10001 "06/30/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  204 380 1 1 0 1
10001 "07/31/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"   59 380 1 1 0 1
10001 "08/31/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  157 380 1 1 0 1
10001 "09/30/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  398 380 1 1 0 1
10001 "10/30/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  260 380 1 1 0 1
10001 "11/30/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"   71 380 1 1 0 1
10001 "12/31/1992" 11 3 "GFGC" "GREAT FALLS GAS CO"  105 380 1 1 0 1
10001 "01/29/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"   44 380 1 1 0 1
10001 "02/26/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"   23 380 1 1 0 1
10001 "03/31/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  137 380 1 1 0 1
10001 "04/30/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  473 380 1 1 0 1
10001 "05/28/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  126 380 1 1 0 1
10001 "06/30/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  987 380 1 1 0 1
10001 "07/30/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  160 380 1 1 0 1
10001 "08/31/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  251 380 1 1 0 1
10001 "09/30/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  178 380 1 1 0 1
10001 "10/29/1993" 11 3 "GFGC" "GREAT FALLS GAS CO"  180 380 1 1 0 1
10001 "11/30/1993" 11 3 "EWST" "ENERGY WEST INC"     112 380 1 1 0 1
10001 "12/31/1993" 11 3 "EWST" "ENERGY WEST INC"     581 380 1 1 0 1
10001 "01/31/1994" 11 3 "EWST" "ENERGY WEST INC"     150 380 1 1 0 1
10001 "02/28/1994" 11 3 "EWST" "ENERGY WEST INC"      58 380 1 1 0 1
10001 "03/31/1994" 11 3 "EWST" "ENERGY WEST INC"     133 380 1 1 0 1
10001 "04/29/1994" 11 3 "EWST" "ENERGY WEST INC"     102 380 1 1 0 1
end
Some companies have a missing value (.) or < 50 for volumes. What I need is that all observations of that specific company are removed if it has a missing value or <50 for volumes. For example if company GREAT FALLS GAS CO has one missing value delete all other observations for this company too. Can someone help me explain how to do this?