<?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 Selection with a Condition in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80324#M3835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not being a statistician in my simple world I would expect a RANDOM sample to have the same characteristics than the universe you draw it from. If this is true then you would first have to "tailor" yourself a universe with the desired characteristics.&lt;/P&gt;&lt;P&gt;I assume you first would have to sub-set your source table and then draw the sample from this sub-set (&lt;A href="http://support.sas.com/kb/24/722.html" title="http://support.sas.com/kb/24/722.html"&gt;http://support.sas.com/kb/24/722.html&lt;/A&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 20:19:11 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2012-04-11T20:19:11Z</dc:date>
    <item>
      <title>Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80321#M3832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi, everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did anybody know how I could select a random sample with a condition? Say, I have a 1 MM customers loan dataset. I wanted to select two random samples with a condition that the average loan balance in each sample should close to $800. Did anybody know how I could do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 19:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80321#M3832</guid>
      <dc:creator>c8826024</dc:creator>
      <dc:date>2012-04-11T19:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80322#M3833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does your data look like? and What are your other criteria?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would a sample of 3 loans, say $10, $800, 1590 be a valid sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80322#M3833</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-04-11T20:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80323#M3834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably would have to adjust the code according to your requirement but this would help as start up for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DATA TEMP;&lt;BR /&gt;INPUT SAMPLE LOAN;&lt;BR /&gt;CARDS;&lt;BR /&gt;1 800&lt;BR /&gt;1 800&lt;BR /&gt;2 100&lt;BR /&gt;3 800&lt;BR /&gt;4 800&lt;BR /&gt;3 800&lt;BR /&gt;4 800&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;SELECT SAMPLE, AVG(LOAN) AS AVG_LOAN FROM TEMP&lt;BR /&gt;WHERE RANUNI(111) &amp;lt; 0.55&lt;BR /&gt;GROUP BY SAMPLE HAVING AVG_LOAN = 800;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sample&amp;nbsp; avg_loan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 800&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 800&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80323#M3834</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-04-11T20:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80324#M3835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not being a statistician in my simple world I would expect a RANDOM sample to have the same characteristics than the universe you draw it from. If this is true then you would first have to "tailor" yourself a universe with the desired characteristics.&lt;/P&gt;&lt;P&gt;I assume you first would have to sub-set your source table and then draw the sample from this sub-set (&lt;A href="http://support.sas.com/kb/24/722.html" title="http://support.sas.com/kb/24/722.html"&gt;http://support.sas.com/kb/24/722.html&lt;/A&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80324#M3835</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-04-11T20:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80325#M3836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A similar question was asked at&amp;nbsp; &lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/122173#122173"&gt;https://communities.sas.com/message/122173&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Lots of suggestions there.&amp;nbsp; It's not clear how your $800 requirement relates to the properties of the data. Is $800 the average balance among all customers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 13:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80325#M3836</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-04-12T13:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample Selection with a Condition</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80326#M3837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two things to consider that would considerably change the approach taken:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What should the variance of the sample sets be? The same for both sets or the same as the population?&lt;/LI&gt;&lt;LI&gt;What is the purpose of the control over the mean (=800$). To eliminate the effect of a cofactor or to match the overall loan population?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 14:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Random-Sample-Selection-with-a-Condition/m-p/80326#M3837</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-12T14:56:43Z</dc:date>
    </item>
  </channel>
</rss>

