<?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 do I create a random sample with an evenly distributed # of obs from each value of a variabl in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337962#M17841</link>
    <description>Thanks for the quick reply! I will get to work on this and see if I can write the appropriate code for my context.</description>
    <pubDate>Fri, 03 Mar 2017 18:51:26 GMT</pubDate>
    <dc:creator>jklukas</dc:creator>
    <dc:date>2017-03-03T18:51:26Z</dc:date>
    <item>
      <title>How do I create a random sample with an evenly distributed # of obs from each value of a variable?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337956#M17839</link>
      <description>&lt;P&gt;Operating in SAS EG 7.1. I have a dataset with about 250K observations. I need to create a sample of this dataset by selecting a random sample of 100 observations from a certain variable. The variable has 5 values, and I need to randomly select 20 observations from each of the 5 values. I was going to use PROC SURVEYSELECT, but I only know how to do that for a random sample of 100 observations of&amp;nbsp;the entire dataset, not of 20 randomly selected observations from each of the 5 values of the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 18:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337956#M17839</guid>
      <dc:creator>jklukas</dc:creator>
      <dc:date>2017-03-03T18:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random sample with an evenly distributed # of obs from each value of a variabl</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337959#M17840</link>
      <description>&lt;P&gt;The STRATA statement is used to provide samples based on the values on one or more variables. The strata does require the data to be sorted by the strata variables &lt;STRONG&gt;before&lt;/STRONG&gt; surveyselect. Use SAMPSIZE=20 and add Strata VariableName; That should get you 20 from each level of the strata variable value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can actually use surveyselect to select different numbers for each level of the strata as well by using () around a list of values in a SAMPSIZE or SAMPRATE option as long as you have one sample size value for each level. SAMPSIZE ( 20 30 15 25 40) for instance would select 20 records from the first (sorted) level of the strata variable, 30 for the second, 15 for the third and so on.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 18:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337959#M17840</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-03T18:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random sample with an evenly distributed # of obs from each value of a variabl</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337962#M17841</link>
      <description>Thanks for the quick reply! I will get to work on this and see if I can write the appropriate code for my context.</description>
      <pubDate>Fri, 03 Mar 2017 18:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-create-a-random-sample-with-an-evenly-distributed-of/m-p/337962#M17841</guid>
      <dc:creator>jklukas</dc:creator>
      <dc:date>2017-03-03T18:51:26Z</dc:date>
    </item>
  </channel>
</rss>

