<?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: Random Sampling with different weights and stratification in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809156#M319068</link>
    <description>&lt;P&gt;Use a dataset as SAMPSIZE= option, as described here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_surveyselect_details25.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/statug/15.2/statug_surveyselect_details25.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 19:33:10 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2022-04-21T19:33:10Z</dc:date>
    <item>
      <title>Random Sampling with different weights and stratification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809153#M319066</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to get a random sample of 500 records out of 1 million records in which I have SEGMENT_MANAGED is either YES OR NO but I want 20 %&amp;nbsp;SEGMENT_MANAGED = YES(100 records) and 80%&amp;nbsp;SEGMENT_MANAGED = NO(400 records).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is given below that I have tried but this gave me 250 records (50%) each SEGMENT_MANAGED =YES or NO.:-&lt;/P&gt;&lt;P&gt;proc surveyselect data = WORK.nps_scrubbed_base_MOB&lt;BR /&gt;out= WORK.nps_sample_file_cad_MOB&lt;BR /&gt;method= srs&lt;BR /&gt;sampsize= 250;&lt;BR /&gt;strata SEGMENT_MANAGED;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Could you please someone help me to find out how to do a random sampling with different weighted according to Strata??&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 19:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809153#M319066</guid>
      <dc:creator>ishant</dc:creator>
      <dc:date>2022-04-21T19:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sampling with different weights and stratification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809156#M319068</link>
      <description>&lt;P&gt;Use a dataset as SAMPSIZE= option, as described here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_surveyselect_details25.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/statug/15.2/statug_surveyselect_details25.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 19:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809156#M319068</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-04-21T19:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sampling with different weights and stratification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809158#M319070</link>
      <description>&lt;P&gt;Or , assumes your strata is variable is actually character. "No" would come before "Yes" so the first number on the SAMPSIZE list goes with the first strata value, the second with second value and so on. If your Strata variable is actually numeric then make sure you know which value is which so you can get the order correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc surveyselect data = WORK.nps_scrubbed_base_MOB
    out= WORK.nps_sample_file_cad_MOB 
    method= srs
     sampsize= (400 100);
    strata SEGMENT_MANAGED;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Apr 2022 19:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Random-Sampling-with-different-weights-and-stratification/m-p/809158#M319070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-21T19:58:01Z</dc:date>
    </item>
  </channel>
</rss>

