<?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 How to sample so sample includes 10% target variable = true and 90% target variable = false in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792622#M253964</link>
    <description>&lt;P&gt;I have a 5m dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;95k have the target variable=1, the rest =0. I want to take a biased sample where I include all 95k cases and a selection of the =0 cases so the split will be 10% true and 90% false. Could anyone share some code to do this please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 18:30:21 GMT</pubDate>
    <dc:creator>EC27556</dc:creator>
    <dc:date>2022-01-26T18:30:21Z</dc:date>
    <item>
      <title>How to sample so sample includes 10% target variable = true and 90% target variable = false</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792622#M253964</link>
      <description>&lt;P&gt;I have a 5m dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;95k have the target variable=1, the rest =0. I want to take a biased sample where I include all 95k cases and a selection of the =0 cases so the split will be 10% true and 90% false. Could anyone share some code to do this please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 18:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792622#M253964</guid>
      <dc:creator>EC27556</dc:creator>
      <dc:date>2022-01-26T18:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to sample so sample includes 10% target variable = true and 90% target variable = false</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792641#M253975</link>
      <description>&lt;P&gt;So you want all the 95k 1's. And you want those 95k to be 10% of your resulting dataset, meaning that you want 950000 - 95000 of the remaining obs from your data?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 19:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792641#M253975</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-01-26T19:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to sample so sample includes 10% target variable = true and 90% target variable = false</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792656#M253978</link>
      <description>&lt;P&gt;Yes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately, I have 100 datasets and would like the sample to always have 10% hit and keep all target incidences where possible. So I want something I can loop for all datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, sometimes I wont be able to use all of my target 'hit' observations because they already represent more than 10% of the aggregate datasets. in this case I would undersample the 'hits' to ensure I have 10% in the sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the most part though, the datasets at an aggregate level have less than 10% of data that has a hit for the target variable. I would like some code to oversample the target variables so I can create a sample with 10% observations that have a hit.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 19:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sample-so-sample-includes-10-target-variable-true-and-90/m-p/792656#M253978</guid>
      <dc:creator>EC27556</dc:creator>
      <dc:date>2022-01-26T19:55:40Z</dc:date>
    </item>
  </channel>
</rss>

