<?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 selection in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218251#M53671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&amp;nbsp; guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 May 2015 19:43:10 GMT</pubDate>
    <dc:creator>Tal</dc:creator>
    <dc:date>2015-05-22T19:43:10Z</dc:date>
    <item>
      <title>random selection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218248#M53668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have table of&amp;nbsp; let's say 234,567 records (2 variables) and need to&amp;nbsp; randomly select 5% of each group (only 2 groups,A and B) and assign those selected&amp;nbsp; records a&amp;nbsp; variable new='randomly selected'; I like to keep the selected records within the same dataset as the non selected ones&lt;/P&gt;&lt;P&gt;so the resulting dataset should be like :&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp; group&amp;nbsp; new&lt;/P&gt;&lt;P&gt;--------------&lt;/P&gt;&lt;P&gt;100&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; randomly selected&lt;/P&gt;&lt;P&gt;101&amp;nbsp; A&lt;/P&gt;&lt;P&gt;102&amp;nbsp; B&lt;/P&gt;&lt;P&gt;103 A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; randomly selected&lt;/P&gt;&lt;P&gt;104 B&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know how to do it in two steps but i was wondering&amp;nbsp; if this can be done&amp;nbsp; in one&amp;nbsp; step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 19:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218248#M53668</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2015-05-21T19:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: random selection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218249#M53669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc sort data=have;by group;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc surveyselect data=have out=want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samprate=5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata group;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting data set will have all of the variables in the base data and some new variables indicating selected and the probability of selection or weight.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 20:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218249#M53669</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-21T20:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: random selection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218250#M53670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;You can use the starta option with all option which will create&amp;nbsp; a varialbe "selected"which have value 1 if the form 5% else 0 for left 90%&amp;nbsp; .&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc sort data=have;by group;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Proc surveyselect data=have&amp;nbsp; ALL&amp;nbsp; out=want&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samprate=5;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata group;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 11:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218250#M53670</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-05-22T11:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: random selection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218251#M53671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&amp;nbsp; guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 19:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/random-selection/m-p/218251#M53671</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2015-05-22T19:43:10Z</dc:date>
    </item>
  </channel>
</rss>

