<?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: BALANCED SAMPLE in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432447#M27922</link>
    <description>&lt;P&gt;my prediction was not good&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 19:11:16 GMT</pubDate>
    <dc:creator>PRISCILABRA</dc:creator>
    <dc:date>2018-01-30T19:11:16Z</dc:date>
    <item>
      <title>BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432422#M27912</link>
      <description>&lt;P&gt;How can I do a balanced sample: example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data with 1000 clients, being of these, 300 are&amp;nbsp;not good and 700 are &amp;nbsp;good&amp;nbsp;(binary, independent variable), and I need to do a proporcional balanced sample, as if I divide&amp;nbsp; 50% good and 50% bad...somebody can help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432422#M27912</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T18:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432424#M27913</link>
      <description>&lt;P&gt;Randomly select X from the not good, and X from the good.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432424#M27913</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-30T18:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432431#M27914</link>
      <description>&lt;P&gt;How can I do this in SAS Enterprise Guide by proc, can you help me?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432431#M27914</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T18:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432437#M27915</link>
      <description>&lt;P&gt;Why not set priors in your regression instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432437#M27915</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T19:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432439#M27916</link>
      <description>&lt;P&gt;I did this in SAS Enterprise Miner...but my sample was not good&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432439#M27916</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T19:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432443#M27918</link>
      <description>&lt;P&gt;I don't see a task that would do this in SAS EG 7.12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need a code node and PROC SURVEYSELECT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could possibly do this in a query by first calculating the numbers needed and then using a random number generated to select that many from each group.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432443#M27918</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T19:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432444#M27919</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I did this in SAS Enterprise Miner...but my sample was not good, some suggestions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432444#M27919</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T19:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432445#M27920</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;my sample was not good&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Your sample or prediction wasn't 'good'? What do you mean by that?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432445#M27920</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T19:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432446#M27921</link>
      <description>&lt;P&gt;that's ok I try. tks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432446#M27921</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T19:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432447#M27922</link>
      <description>&lt;P&gt;my prediction was not good&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432447#M27922</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T19:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432451#M27923</link>
      <description>&lt;P&gt;my prediction, ROC was very low...I need to do a random before by proc...understand? I try to do with proc surveyselect, thanks a lot. bye&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:17:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432451#M27923</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-30T19:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432456#M27924</link>
      <description>&lt;P&gt;Actually, you could take all of the 30% sample and then some of the other sample until the N's match, that's should be relatively easy in a data step.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create sample data - with  a random number;
data have;
	call streaminit(25);

	*set stream for random number - means same results every time;
	group=1;

	do i=1 to 30;
		x=rand('normal', 25, 5);
		output;
	end;

	group=2;

	do i=1 to 70;
		x=rand('normal', 35, 2);
		output;
	end;
run;

*sort with random number to randomize;
proc sort data=have;
	by group x;
run;

data want;
	set have;
	by group;
	retain counter flag max_count;

	if _n_=1 then
		flag=0;

	if first.group then
		counter=0;
	counter+1;

	if last.group and flag=0 then
		do;
			flag=1;
			max_count=counter;
		end;

	if flag=1 and counter&amp;gt; max_count then
		stop;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432456#M27924</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T19:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432670#M27948</link>
      <description>&lt;P&gt;Goog Morning,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried and it worked out. Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 11:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432670#M27948</guid>
      <dc:creator>PRISCILABRA</dc:creator>
      <dc:date>2018-01-31T11:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: BALANCED SAMPLE</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432712#M27971</link>
      <description>&lt;P&gt;Are you using German Credit.xlsx for making a CreditCard ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="/courses/d8fb3215ba27fe300/1--German Credit.xlsx" 
out=have dbms=xlsx replace;
run;
proc sort data=have;by good_bad;run;
proc surveyselect data=have out=want sampsize=(300 300) seed=12345678;
strata good_bad;
run;
proc freq data=want;
table good_bad;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jan 2018 13:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/BALANCED-SAMPLE/m-p/432712#M27971</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-31T13:26:55Z</dc:date>
    </item>
  </channel>
</rss>

