<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate 2.5 percentila and 97.5 percentile in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10973#M136</link>
    <description>You are going to have to show you work.  When I run my program there IS a variable P2_5.</description>
    <pubDate>Wed, 16 Feb 2011 19:41:42 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-02-16T19:41:42Z</dc:date>
    <item>
      <title>Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10967#M130</link>
      <description>Hello:&lt;BR /&gt;
&lt;BR /&gt;
I have a relatively large data set (around 100,000 rows), I used the following code to calculate the 5th and 95th percentile,&lt;BR /&gt;
&lt;BR /&gt;
proc means data=fulldata3;&lt;BR /&gt;
VAR DV;&lt;BR /&gt;
CLASS GROUP TREA CMT STIM;&lt;BR /&gt;
output out=percentiles2 mean=mean P5=P5 P95=P95;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The data have 30 GROUPs, each GROUP has 4 TREAs, each TREA have 4 CMTs, every CMTs have the same STIM (scheduled time). But the above code cannot calculate the 2.5 and 97.5 percentile, since proc means does not have P2.5 and P97.5&lt;BR /&gt;
&lt;BR /&gt;
I was trying to use &lt;BR /&gt;
proc univariate data=fulldata3;&lt;BR /&gt;
VAR DV;&lt;BR /&gt;
CLASS GROUP TREA CMT STIM;&lt;BR /&gt;
output out=percentiles1 mean=mean pctlpts=2.5 97.5 pctlpre=P;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The error message is "ERROR: Cannot specify more than two CLASS variables"&lt;BR /&gt;
&lt;BR /&gt;
Then, I tried to use &lt;BR /&gt;
proc univariate data=fulldata3;&lt;BR /&gt;
VAR DV;&lt;BR /&gt;
By GROUP TREA CMT STIM;&lt;BR /&gt;
output out=percentiles1 mean=mean pctlpts=2.5 97.5 pctlpre=P;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
It pumped out "windows is full and must be cleared select" and after I made a selection, it keeps doing that. I have stay there and click "C to clear windows without saving ". After a while I got the output, but the title was like the following, &lt;BR /&gt;
"the 2.5000 percentile, DV", this name is not recognized as a variable which I will further process.&lt;BR /&gt;
&lt;BR /&gt;
I hope to get some help about this issue. &lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Wed, 16 Feb 2011 03:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10967#M130</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-16T03:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10968#M131</link>
      <description>Hello:&lt;BR /&gt;
&lt;BR /&gt;
I think the noprint option ought to stop the pumping out of the "windows is full and must be cleared select".  So, the question left was that how to make the variable name in the output file from the proc univariate so that it can be processed later.  The column name right now is  like ""the 2.5000 percentile, DV".</description>
      <pubDate>Wed, 16 Feb 2011 04:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10968#M131</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-16T04:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10969#M132</link>
      <description>I could be missing something.  Do you want the percentiles across all data, or the percentiles within each sub-sub-subclass?  I assume the latter.&lt;BR /&gt;
&lt;BR /&gt;
I ran this code (with the NOPRINT option) against a dataset with several clinical chemistry endpoints and groups.  The output dataset contained the following (output from PROC CONTENTS):&lt;BR /&gt;
&lt;BR /&gt;
Alphabetic List of Variables and Attributes&lt;BR /&gt;
&lt;BR /&gt;
#    Variable    Type    Len    Format    Informat    Label&lt;BR /&gt;
&lt;BR /&gt;
4    GRP_NO      Num       8&lt;BR /&gt;
2    MEAS_CD     Num       8    11.       11.         MEAS_CD&lt;BR /&gt;
6    P2_5        Num       8                          the   2.5000 percentile, value&lt;BR /&gt;
7    P97_5       Num       8                          the  97.5000 percentile, value&lt;BR /&gt;
1    insum       Num       8&lt;BR /&gt;
5    mean        Num       8                          the mean, value&lt;BR /&gt;
3    measureM    Char     91&lt;BR /&gt;
&lt;BR /&gt;
(Sorry about the wrapping, and this may not look so good in a proportional font)&lt;BR /&gt;
&lt;BR /&gt;
Anyway, the variables you need would all be there, with proper values for each of your by variables.&lt;BR /&gt;
&lt;BR /&gt;
Steve Denham&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: SteveDenham

Message was edited by: SteveDenham</description>
      <pubDate>Wed, 16 Feb 2011 12:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10969#M132</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2011-02-16T12:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10970#M133</link>
      <description>hi SteveDenham 	:&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply. The issue is with the label for the percentile, e.g."the 2.5000 percentile, value" I need to use this variable later, but since there is a comma in the label (maybe other things I am not aware of), I cannot get access to the 2.5 percentile in the output file from the proc univariate in the following example.&lt;BR /&gt;
&lt;BR /&gt;
Proc means data=output (this is the output from the proc univariate);&lt;BR /&gt;
var the 2.5000 percentile, value;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This code did not work.  "the 2.5000 percentile, value" is not recognized</description>
      <pubDate>Wed, 16 Feb 2011 14:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10970#M133</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-16T14:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10971#M134</link>
      <description>You are confusing NAMES and LABELS.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sort data=sashelp.class out=class;&lt;BR /&gt;
   by sex;&lt;BR /&gt;
proc univariate data=class;&lt;BR /&gt;
   by sex;&lt;BR /&gt;
   var height;&lt;BR /&gt;
   output out=percentiles1 mean=mean pctlpts=2.5 97.5 pctlpre=P;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
Obs    Sex      mean     P2_5    P97_5&lt;BR /&gt;
&lt;BR /&gt;
 1      F     60.5889    51.3     66.5&lt;BR /&gt;
 2      M     63.9100    57.3     72.0&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 16 Feb 2011 15:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10971#M134</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-02-16T15:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10972#M135</link>
      <description>Hi data _null_; 	&lt;BR /&gt;
&lt;BR /&gt;
I think there is a misunderstanding between us. &lt;BR /&gt;
&lt;BR /&gt;
what I intended do is as following based on your code,&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=sashelp.class out=class;&lt;BR /&gt;
   by sex;&lt;BR /&gt;
proc univariate data=class;&lt;BR /&gt;
   by sex;&lt;BR /&gt;
   var height;&lt;BR /&gt;
   output out=percentiles1 mean=mean pctlpts=2.5 97.5 pctlpre=P;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc mean data=percentiles1;&lt;BR /&gt;
var P2_5;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/*the last piece of code will not work because there is no  P2_5 in percentiles1 */</description>
      <pubDate>Wed, 16 Feb 2011 16:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10972#M135</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-16T16:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10973#M136</link>
      <description>You are going to have to show you work.  When I run my program there IS a variable P2_5.</description>
      <pubDate>Wed, 16 Feb 2011 19:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10973#M136</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-02-16T19:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10974#M137</link>
      <description>The code by data _null_ should work. I just wrote a demonstration program (with a few class factors), and you &lt;B&gt;definitely &lt;/B&gt;get a variable called P2_5. Everything works fine.&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
do A = 1 to 5;&lt;BR /&gt;
	do B = 1 to 3;&lt;BR /&gt;
		do C = 1 to 7;&lt;BR /&gt;
			do rep = 1 to 200;&lt;BR /&gt;
				y = rannor(1);&lt;BR /&gt;
				output;&lt;BR /&gt;
			end;&lt;BR /&gt;
		end;&lt;BR /&gt;
	end;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=a(obs=300);&lt;BR /&gt;
run;&lt;BR /&gt;
proc univariate data=a;&lt;BR /&gt;
by A B C;&lt;BR /&gt;
var y;&lt;BR /&gt;
output out=percentiles1 mean=mean pctlpts=2.5 97.5 pctlpre=P;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=percentiles1;&lt;BR /&gt;
run;&lt;BR /&gt;
proc means data=percentiles1;&lt;BR /&gt;
var P2_5;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 16 Feb 2011 20:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10974#M137</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-02-16T20:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10975#M138</link>
      <description>Hello:&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your guys help. The P2_5 works. I did not know this P2_5 is the name. &lt;BR /&gt;
I am "confusing NAMES and LABELS".&lt;BR /&gt;
&lt;BR /&gt;
Thanks again</description>
      <pubDate>Wed, 16 Feb 2011 20:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10975#M138</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-16T20:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate 2.5 percentila and 97.5 percentile</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10976#M139</link>
      <description>Hi.&lt;BR /&gt;
Another workaround way is to use ' proc rank ', set rank=1000,then value of rank with 25 is&lt;BR /&gt;
the 2.5 percentila.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 28 Feb 2011 09:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-2-5-percentila-and-97-5-percentile/m-p/10976#M139</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-28T09:50:20Z</dc:date>
    </item>
  </channel>
</rss>

