```Date: Sun, 6 Feb 2011 23:50:44 +0800 Reply-To: Murphy Choy Sender: "SAS(r) Discussion" From: Murphy Choy Subject: Re: Quartile question Comments: To: Dave Brewer In-Reply-To: <201102061523.p16BlKQV029880@willow.cc.uga.edu> Content-Type: text/plain; charset=ISO-8859-1 Hi Dave, I hope this helps. On Sun, Feb 6, 2011 at 11:23 PM, Dave Brewer wrote: > Murphy, > > Thanks much for your example and help. > Dave > > On Sat, 5 Feb 2011 14:45:50 +0800, Murphy Choy wrote: > > >Hi Dave, > > > >First create a percentile variable in the data A. > > > >PROC RANK DATA = A OUT = A1 GROUPS = 100; > >VAR MPR; > >RANKS MPR_RANK; > >RUN; > > > >With this, you have a new variable which gives you percentile. Using this, > >you can summarized based on percentile. > > > >PROC TABULATE DATA = A1(WHERE = (MPR_RANK IN (25,50,75,0,99))); > >CLASS MPR_RANK; > >TABLE MPR_RANK, MPR*(MIN MAX N); > >RUN; > > > >Not sure if this helps. > > > >On Sat, Feb 5, 2011 at 9:58 AM, Dave Brewer wrote: > > > >> I'm sorry, but I don't understand what you are suggesting? Can you > provide > >> an example with code? > >> > >> Thanks. > >> Dave > >> > >> On Sat, 5 Feb 2011 09:55:32 +0800, Murphy Choy > wrote: > >> > >> >Hi, > >> > > >> >Perhaps a better alternative is to use PROC RANK. > >> > > >> >Use PROC Rank to create 100 deciles. > >> > > >> >Do a PROC TABULATE to calculate the number of people in each quartile > and > >> >min/max. > >> > > >> >On Sat, Feb 5, 2011 at 9:47 AM, Dave wrote: > >> > > >> >> Hi All, > >> >> > >> >> Let me start off by stating that I am not a mathematician or a > >> >> statistician, just a lowly SAS programmer. > >> >> > >> >> I ran a PROC MEANS to calculate Q1-Q4, MIN and MAX for a variable > called > >> >> MPR. When I showed the results to the investigator, she wants to know > >> how > >> >> many people are in each quartile (or how many in MIN or MAX). > >> >> > >> >> Is this possible without a lot of work on my end? > >> >> > >> >> Thanks all for your help. > >> >> Dave > >> >> > >> > > >> > > >> > > >> >-- > >> >Regards, > >> >Murphy Choy > >> > > >> >Certified Advanced Programmer for SAS V9 > >> >Certified Basic Programmer for SAS V9 > >> >DataShaping Certified SAS Professional > >> > > > > > > > >-- > >Regards, > >Murphy Choy > > > >Certified Advanced Programmer for SAS V9 > >Certified Basic Programmer for SAS V9 > >DataShaping Certified SAS Professional > -- Regards, Murphy Choy Certified Advanced Programmer for SAS V9 Certified Basic Programmer for SAS V9 DataShaping Certified SAS Professional ```

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