LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 11 Feb 2005 00:43:10 -0500
Reply-To:   Haigang Zhou <hzhou3@UNLSERVE.UNL.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Haigang Zhou <hzhou3@UNLSERVE.UNL.EDU>
Subject:   Computing Percentages within Subtotals

I have some stock prices as shown below. I want to count the number of occurrences of "-9" for each stock (stk1 - stk5), and delete a stock if the total number of occurrences of "-9" exceeds 15% of the total observations. For example, stk1 has 5 occurrences of "-9", and therefore, I want to delete the entire column from the dataset.

Thank you very much!

DATA ONE; INPUT date acx dyk ojm wuq btr; DATALINES; 1 16.15 19.63 19.55 15.86 12.36 2 10.74 -9.00 13.01 11.62 17.77 3 18.10 11.51 10.95 10.09 15.88 4 17.00 18.80 11.19 15.87 15.56 5 12.38 -9.00 16.14 10.73 12.85 6 -9.00 14.16 -9.00 11.22 16.59 7 12.60 13.54 12.85 -9.00 11.90 8 -9.00 13.17 10.52 14.97 13.55 9 12.75 13.18 14.41 18.20 14.13 10 -9.00 17.35 11.92 18.61 10.02 11 18.49 -9.00 -9.00 16.01 16.41 12 18.40 12.07 19.66 13.66 18.61 13 -9.00 12.39 15.79 18.00 10.07 14 -9.00 19.72 12.83 19.28 15.46 15 16.77 19.11 -9.00 11.47 10.56 16 10.03 -9.00 10.08 15.21 12.65 17 16.18 10.04 14.14 12.86 14.45 18 19.01 14.67 12.67 19.76 12.06 19 18.86 19.03 16.91 12.99 15.85 20 18.02 12.06 14.99 16.02 13.70 ; RUN;


Back to: Top of message | Previous page | Main SAS-L page