<?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 Sample Question in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155363#M12128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One start would be to post the code currently using (or generated by EG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally to select per stratum your Sampsize option has one value per stratum. If you have varying number of strata and records per strata you're going to need to 1) determine # strata per data set, 2) calculate sampsize per strata 3) determine total records and records per strata and pass parameters to surveyselect. This sounds like it may be a requirement for some macro programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ALLOC option may help with some.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jun 2014 18:14:37 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-06-25T18:14:37Z</dc:date>
    <item>
      <title>Random Sample Question</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155362#M12127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; Utilizing proc Survey select I am trying to get a random&lt;BR /&gt;sample of 10 records per dataset I have created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each data set has been created based on specific criteria.&lt;BR /&gt;Unfortunately we will be running qtrly and each data set will not always have&lt;BR /&gt;10 records to choose from and in some instances may have not data at all. How&lt;BR /&gt;can I update my code to select N=10 and when there are less than 10 records it&lt;BR /&gt;pull all available?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Within specific datasets the random sample needs to include&lt;BR /&gt;a Strata Variable. I would also like to have 10 records pulled total but broken&lt;BR /&gt;out evenly between the strata, it is currently pulling proportionally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 18:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155362#M12127</guid>
      <dc:creator>H4xc1ty</dc:creator>
      <dc:date>2014-06-25T18:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Question</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155363#M12128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One start would be to post the code currently using (or generated by EG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally to select per stratum your Sampsize option has one value per stratum. If you have varying number of strata and records per strata you're going to need to 1) determine # strata per data set, 2) calculate sampsize per strata 3) determine total records and records per strata and pass parameters to surveyselect. This sounds like it may be a requirement for some macro programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ALLOC option may help with some.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 18:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155363#M12128</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-25T18:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Question</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155364#M12129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;Below is the code in its current state.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;how can it be updated that I can get an even number of strata (right now AllLOC=Prop and I am getting 9 records for one strata and 1 for the other due to source proportion. I would like even break out so in this case with N=10 it would be 5 each. The below is specific to one dataset that has enough records to choose from but some of the other datasets do not. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; _CLIENTTASKFILTER = status = 'Approved';&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;SORT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=WORK.MMC_FHP( &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=(status = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'Approved'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) )&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;OUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=WORK.SORTTempTableSorted;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; benefit_plan;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;SURVEYSELECT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=WORK.SORTTempTableSorted&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;OUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=WORK.MMC_FHP_APPROVAL_SAMPLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;METHOD&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=SRS&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;SEED&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;NOPRINT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;STRATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; benefit_plan / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;ALLOC&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=PROP;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;_CLIENTTASKFILTER;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 18:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155364#M12129</guid>
      <dc:creator>H4xc1ty</dc:creator>
      <dc:date>2014-06-25T18:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Question</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155365#M12130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get two strata with equal numbers of samples:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 12pt;"&gt;&lt;STRONG&gt;SURVEYSELECT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;=WORK.SORTTempTableSorted&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;OUT&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;=WORK.MMC_FHP_APPROVAL_SAMPLE&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;METHOD&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;=SRS&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;=(5 5) &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; color: #008080; font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;SEED&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; color: #008080; font-size: 12pt;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; color: #008080; font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;NOPRINT&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #0000ff; font-size: 12pt;"&gt;STRATA&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt; benefit_plan / &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;You may want to look at the secondary dataset option in surveyselect as you can calculate such things as the number of strata and sample per strata and get them into a data set for parameters. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 21:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-Question/m-p/155365#M12130</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-25T21:58:58Z</dc:date>
    </item>
  </channel>
</rss>

