<?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 How to randomly select responses with replacement, but evenly distributed across groups? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810838#M39929</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am looking at a survey data set of 694 responses who are in 12 different age groups but the distribution of responses heavily skew to younger age groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is how to randomly select those 694 responses with replacement, but evenly distributed across 12 age groups?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Ethan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t75wez1_0-1651347750450.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71029i7E68F3D74CA652B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t75wez1_0-1651347750450.png" alt="t75wez1_0-1651347750450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Apr 2022 19:43:46 GMT</pubDate>
    <dc:creator>t75wez1</dc:creator>
    <dc:date>2022-04-30T19:43:46Z</dc:date>
    <item>
      <title>How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810838#M39929</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am looking at a survey data set of 694 responses who are in 12 different age groups but the distribution of responses heavily skew to younger age groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is how to randomly select those 694 responses with replacement, but evenly distributed across 12 age groups?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Ethan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t75wez1_0-1651347750450.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71029i7E68F3D74CA652B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t75wez1_0-1651347750450.png" alt="t75wez1_0-1651347750450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 19:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810838#M39929</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2022-04-30T19:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810842#M39930</link>
      <description>&lt;P&gt;Use stratified random sampling. Proc surveyselect does that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Prepare some test data */
data heart;
set sashelp.heart;
if ageAtDeath &amp;gt; 34;
ageGroup = round(ageAtDeath, 10);
run;

title "Population frequencies";
proc freq data=heart;
table ageGroup;
run;

/* Data must be sorted by strata, prior to random sampling */
proc sort data=heart; by ageGroup; run;

proc surveyselect data=heart sampsize=10 out=sample noprint;
strata ageGroup;
run;

title "Sample frequencies";
proc freq data=sample;
table ageGroup;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1651351315429.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71030i09D9EC0B19245786/image-size/large?v=v2&amp;amp;px=999" role="button" title="PGStats_0-1651351315429.png" alt="PGStats_0-1651351315429.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 20:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810842#M39930</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-04-30T20:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810856#M39934</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks PGStats, What if I want to have the sample size greater than 20 in "proc surveyselect". so some of responses could be re-selected for certain age groups. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to make a change in your code below?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 23:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810856#M39934</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2022-04-30T23:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810859#M39936</link>
      <description>&lt;P&gt;You can request unrestricted random sampling (sampling with replacement) by specifying options METHOD=URS OUTHITS in the proc surveyselect statement. This will allow sampling sizes greater than the strata sizes but will allow replicates in every stratum.&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 02:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810859#M39936</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-05-01T02:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810987#M39944</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi PGStats,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It works perfectly. Thanks a ton for the sublime solution you provided.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 03:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/810987#M39944</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2022-05-02T03:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811006#M39947</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/23924"&gt;@t75wez1&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Glad to see that PGStats's solution worked for you. Then it would be fair and help later readers if you marked his helpful reply as the accepted solution, not your own "thank you" post. Could you please change that? It's very easy: Select his post&amp;nbsp;as the solution after clicking&amp;nbsp;"Not the Solution" in the option menu (see icon below) of the current solution.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="show_option_menu.png" style="width: 155px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71065i473500775DC3205D/image-size/large?v=v2&amp;amp;px=999" role="button" title="show_option_menu.png" alt="show_option_menu.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 07:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811006#M39947</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-05-02T07:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811076#M39955</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello FreelanceRehard,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I got the email stated that "Great job! You marked your answer to a question as an accepted solution!"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and I don't see "Not the solution" option from "Show option menu" you indicated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t75wez1_0-1651502724181.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71070iC097FF6D2E2E75D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t75wez1_0-1651502724181.png" alt="t75wez1_0-1651502724181.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 14:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811076#M39955</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2022-05-02T14:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly select responses with replacement, but evenly distributed across groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811078#M39956</link>
      <description>&lt;P&gt;The item&amp;nbsp;&lt;SPAN&gt;"Not the solution" is only available in the option menu &lt;EM&gt;of the current solution&lt;/EM&gt;&amp;nbsp;(i.e., &lt;EM&gt;your&lt;/EM&gt; post with the green background color).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 15:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-select-responses-with-replacement-but-evenly/m-p/811078#M39956</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-05-02T15:02:35Z</dc:date>
    </item>
  </channel>
</rss>

