<?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: How to get SAS code for percentile in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621514#M77231</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Okay, I am totally new to SAS. So still getting the hang of things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; A2;&lt;/P&gt;&lt;P&gt;A1= &lt;STRONG&gt;1&lt;/STRONG&gt;-probnorm(&lt;STRONG&gt;2&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;D= &lt;STRONG&gt;1&lt;/STRONG&gt; - cdf('NORMAL'12,8,&lt;STRONG&gt;2&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;Put D=;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2020 18:29:05 GMT</pubDate>
    <dc:creator>Joliek44</dc:creator>
    <dc:date>2020-01-31T18:29:05Z</dc:date>
    <item>
      <title>How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621484#M77228</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a question about finding the probability of upper end of normal distribution. The mean=8 in, SD=2 in. Trying to find the probability of variable that will be over &amp;gt;12 in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Used&amp;nbsp;&lt;/P&gt;&lt;P&gt;Z=P(X&amp;gt;12)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Z= 1- P(X&amp;lt;12-8/2)&lt;/P&gt;&lt;P&gt;Z= 1-p(X&amp;lt;2)&lt;/P&gt;&lt;P&gt;Z=1-0.07725&lt;/P&gt;&lt;P&gt;Z=0.02275&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I am trying to write code into SAS:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data 2a;&lt;BR /&gt;A1= 1-probnorm(2);&lt;BR /&gt;C= 1 - cdf('NORMAL',2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=2a;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know its wrong and need any suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621484#M77228</guid>
      <dc:creator>Joliek44</dc:creator>
      <dc:date>2020-01-31T16:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621489#M77229</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/308437"&gt;@Joliek44&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/308437"&gt;@Joliek44&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;data 2a;&lt;BR /&gt;A1= 1-probnorm(2);&lt;BR /&gt;C= 1 - cdf('NORMAL',2);&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Remember that, as a rule, names in SAS, in particular dataset names, must start with a letter or an underscore. The formulas using the standardized argument (12-8)/2=2 are correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you don't need to compute the standardized argument yourself (see documentation of the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1rnj32uvtwnvfn1kwnsg9d6w6h7.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;CDF function for the normal distribution&lt;/A&gt;). Just specify all three numeric arguments of the CDF function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
p=1-cdf('normal',12,8,2);
put p=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(This writes the result to the log without creating a dataset.)&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 17:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621489#M77229</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-31T17:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621514#M77231</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Okay, I am totally new to SAS. So still getting the hang of things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; A2;&lt;/P&gt;&lt;P&gt;A1= &lt;STRONG&gt;1&lt;/STRONG&gt;-probnorm(&lt;STRONG&gt;2&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;D= &lt;STRONG&gt;1&lt;/STRONG&gt; - cdf('NORMAL'12,8,&lt;STRONG&gt;2&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;Put D=;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 18:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621514#M77231</guid>
      <dc:creator>Joliek44</dc:creator>
      <dc:date>2020-01-31T18:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621516#M77232</link>
      <description>&lt;P&gt;With a comma inserted between &lt;FONT face="courier new,courier"&gt;'NORMAL'&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;12&lt;/FONT&gt; this is going to work. It will produce two identical results in variables A1 and D in dataset A2 and in addition write the result to the log.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 18:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621516#M77232</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-31T18:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621519#M77233</link>
      <description>&lt;P&gt;Got!!! Thanks for your help. Finally.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 18:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621519#M77233</guid>
      <dc:creator>Joliek44</dc:creator>
      <dc:date>2020-01-31T18:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621552#M77234</link>
      <description>&lt;P&gt;It sounds like your question is answered, but I just want to comment on the title of this topic. You asked how to compute a percentile, but the quantity that you are computing is a probability, not a percentile. A percentile is the inverse problem. The percentile is also called the quantile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given a probability, such as 0.02, the quantile is the value z0 such that P(Z &amp;lt; z0) = 0.02. You can compute it as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* lower tail */&lt;BR /&gt;z0 = quantile("normal", 0.02, 8, 2); /* z0 = 3.89 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes you might be interested in the upper tail instead:&lt;/P&gt;
&lt;P&gt;/* upper tail */&lt;BR /&gt;z1 = quantile("normal", 1-0.02, 8, 2); /* z1 = 12.11 */&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 21:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/621552#M77234</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-01-31T21:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SAS code for percentile</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/622608#M77290</link>
      <description>&lt;P&gt;Thank you for the information. Will keep that in mind. Great explanation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Monica&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 04:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-SAS-code-for-percentile/m-p/622608#M77290</guid>
      <dc:creator>Joliek44</dc:creator>
      <dc:date>2020-02-06T04:58:48Z</dc:date>
    </item>
  </channel>
</rss>

