<?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: Attach percentile data to my dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565633#M158832</link>
    <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
    class var2;
    var var1;
    output out=pctiles p25=p25 p50=p50 p75=75;
run;
proc sort data=have;
    by var2;
run;
data want;
    merge have pctiles;
    by var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Jun 2019 17:41:31 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-06-12T17:41:31Z</dc:date>
    <item>
      <title>Attach percentile data to my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565627#M158829</link>
      <description>&lt;P&gt;I have a dataset for which I want to know the p25, p50, and p75 (and maybe other) percentiles for var1 (first variable) when the data is grouped by var2 (second variable).&amp;nbsp; I was able to do this using PROC UNIVARIATE but I then lose my original data once I output from PROC UNIVARIATE.&amp;nbsp; Is there a way to calculate the percentiles and merge it back with my original dataset?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 17:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565627#M158829</guid>
      <dc:creator>benvar</dc:creator>
      <dc:date>2019-06-12T17:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attach percentile data to my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565633#M158832</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
    class var2;
    var var1;
    output out=pctiles p25=p25 p50=p50 p75=75;
run;
proc sort data=have;
    by var2;
run;
data want;
    merge have pctiles;
    by var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2019 17:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565633#M158832</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-12T17:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Attach percentile data to my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565634#M158833</link>
      <description>&lt;P&gt;You can't attach it as part of PROC UNIVARIATE.&amp;nbsp; Run that first, then put the results back onto your original data set ... either MERGE by VAR2, or use SQL, matching on VAR2.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 17:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565634#M158833</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-12T17:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attach percentile data to my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565647#M158837</link>
      <description>&lt;P&gt;Here's an illustration of two different methods:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option, if you're trying to bin groups with percentiles is to use the RANK procedure instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277499"&gt;@benvar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset for which I want to know the p25, p50, and p75 (and maybe other) percentiles for var1 (first variable) when the data is grouped by var2 (second variable).&amp;nbsp; I was able to do this using PROC UNIVARIATE but I then lose my original data once I output from PROC UNIVARIATE.&amp;nbsp; Is there a way to calculate the percentiles and merge it back with my original dataset?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 19:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attach-percentile-data-to-my-dataset/m-p/565647#M158837</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-12T19:11:18Z</dc:date>
    </item>
  </channel>
</rss>

