<?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 from another data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419432#M103135</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea how to get started on this. I was thinking of creating an array with DO LOOPS to get the observation&amp;nbsp;but not sure&amp;nbsp;&lt;/P&gt;&lt;P&gt;where to start it as I am very new to SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you need anything else. I will be attaching a sample of my code soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Sun, 10 Dec 2017 13:44:55 GMT</pubDate>
    <dc:creator>at803535</dc:creator>
    <dc:date>2017-12-10T13:44:55Z</dc:date>
    <item>
      <title>random sample from another data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419432#M103135</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea how to get started on this. I was thinking of creating an array with DO LOOPS to get the observation&amp;nbsp;but not sure&amp;nbsp;&lt;/P&gt;&lt;P&gt;where to start it as I am very new to SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you need anything else. I will be attaching a sample of my code soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2017 13:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419432#M103135</guid>
      <dc:creator>at803535</dc:creator>
      <dc:date>2017-12-10T13:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: random sample from another data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419442#M103141</link>
      <description>&lt;P&gt;Try PROC SURVEYSELECT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 02:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419442#M103141</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-08T02:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: random sample from another data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419476#M103155</link>
      <description>&lt;P&gt;Look at the &lt;STRONG&gt;strata statement&lt;/STRONG&gt; and the&amp;nbsp;&lt;STRONG&gt;Secondary input dataset&lt;/STRONG&gt; feature of &lt;STRONG&gt;proc surveyselect&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 05:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419476#M103155</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-08T05:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: random sample from another data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419487#M103159</link>
      <description>&lt;P&gt;I would probably do this in two distinct PROC SURVEYSELECT steps like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made example data set from sashelp.cars and made arbitrary mileage categories for demonstration purposes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
	set sashelp.cars;
	length mileage $20;
	if mpg_city&amp;lt;16 then mileage='Bad';
	else if 16&amp;lt;=mpg_city&amp;lt;25 then mileage='Fair';
	else if 25&amp;lt;=mpg_city&amp;lt;30 then mileage='Good';
	else mileage='Excellent';
	do i=1 to 100; output; end;
	drop i;
run;

proc sort data=cars;
	by mileage;
run;

proc surveyselect data=cars out=sample1 method=srs n=200 noprint;
	where mileage in ('Bad', 'Excellent');
	strata mileage;
run;

proc surveyselect data=cars out=sample2 method=srs samprate=0.01 noprint;
	where mileage in ('Fair', 'Good');
	strata mileage;
run;

data finalsample;
	set sample1 sample2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 09:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/random-sample-from-another-data-set/m-p/419487#M103159</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-08T09:34:07Z</dc:date>
    </item>
  </channel>
</rss>

