<?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 Random Sample of a non-event in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159953#M2943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a logistic regression-- binary outcome. The 1 (or the event) has a sample size of 600, while the 0 (non-event) has a sample size of 8000.&lt;/P&gt;&lt;P&gt;How do I extract a random sample of 600 of the non-event? It seems like proc suveyselect only lets me take a random sample of all participants, not just those who fall in the non-event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Aug 2014 20:35:14 GMT</pubDate>
    <dc:creator>murugan</dc:creator>
    <dc:date>2014-08-13T20:35:14Z</dc:date>
    <item>
      <title>Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159953#M2943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a logistic regression-- binary outcome. The 1 (or the event) has a sample size of 600, while the 0 (non-event) has a sample size of 8000.&lt;/P&gt;&lt;P&gt;How do I extract a random sample of 600 of the non-event? It seems like proc suveyselect only lets me take a random sample of all participants, not just those who fall in the non-event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 20:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159953#M2943</guid>
      <dc:creator>murugan</dc:creator>
      <dc:date>2014-08-13T20:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159954#M2944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On the input dataset name use the where option to select input records only for specific values. This completely subsets the data. The selection probability and weights will only work for that subset so be careful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyselect data=lib.have (where=(eventvariable = 0)) ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 20:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159954#M2944</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-13T20:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159955#M2945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code is not working. I keep getting an error message that says that my use of the where statement is incorrect. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 17:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159955#M2945</guid>
      <dc:creator>murugan</dc:creator>
      <dc:date>2014-08-15T17:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159956#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post the code you're submitting&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 18:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159956#M2946</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-15T18:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159957#M2947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems like trying to make a dataset containing equal number of event and non-event cases. Try this to get the desired sample dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if y=1 or (y=0 and ranuni(1234)&amp;lt;0.075) then output;&amp;nbsp;&amp;nbsp; /* Suppose y is the event variable */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 18:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159957#M2947</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-15T18:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159958#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I used the code that you suggested, I got: data set has 0 observations and 1 variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to make a dataset containing an equal number of event and non-event cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 19:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159958#M2948</guid>
      <dc:creator>murugan</dc:creator>
      <dc:date>2014-08-15T19:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159959#M2949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for all of your help! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 19:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159959#M2949</guid>
      <dc:creator>murugan</dc:creator>
      <dc:date>2014-08-15T19:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample of a non-event</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159960#M2950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you had clearly stated your need earlier then STRATA in survey select with event and nonevent sample sizes specified would have worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 20:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-Sample-of-a-non-event/m-p/159960#M2950</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-15T20:14:40Z</dc:date>
    </item>
  </channel>
</rss>

