<?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: proc surveyselect double stratification in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449783#M23503</link>
    <description>&lt;P&gt;That works! Thank you so much. This is a great lesson for me to be wary of "tunnel vision". I focused so much on surveyselect I neglected to entertain other possible solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 21:58:38 GMT</pubDate>
    <dc:creator>Jeff_DOC</dc:creator>
    <dc:date>2018-03-29T21:58:38Z</dc:date>
    <item>
      <title>proc surveyselect double stratification</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449747#M23494</link>
      <description>&lt;P&gt;Good afternoon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've posed this question before but can't seem to get a resolution to my dilemma. What I have is a list of locations with&amp;nbsp;groups of&amp;nbsp;caseload numbers within those locations. A caseload number can be repeated within a location a random number of times. What I need is a random selection of caseload numbers from within each location. Each location must have 11 total selections and each caseload must have at least one selection. So basically the strata are location and caseload and the n required are 11 and 1. I cannot figure out how to make this two step stratification selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there a fewer than 11 selections in the location strata I need them all as long as I get one from each caseload. If there are more than 11 possible selections in the location strata I only need 11 total but 1 from each caseload. There are fewer than 11 caseloads in each location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone assist me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code example:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;surveyselect&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = have01&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = want01&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;selectall&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;n&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;11&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;method&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=srs;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;strata&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; audit_location caseload;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 19:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449747#M23494</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2018-03-29T19:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselect double stratification</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449766#M23495</link>
      <description>&lt;P&gt;I will&amp;nbsp;try to propose something that works for your data&amp;nbsp;if you post&amp;nbsp;it as a text file.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 20:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449766#M23495</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-29T20:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselect double stratification</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449767#M23496</link>
      <description>&lt;P&gt;Thank you so much for the assist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this attachment help?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 20:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449767#M23496</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2018-03-29T20:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselect double stratification</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449780#M23502</link>
      <description>&lt;P&gt;I can't see how to do this with &lt;STRONG&gt;proc surveyselect&lt;/STRONG&gt;. You could however use this quick method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(96688);
infile "&amp;amp;sasforum\datasets\surveyselect_test_file.txt" firstobs=2 dlm='09'x;
input location :$12. caseload $;
id = _n_;              /* Identify each obs */
rnd = rand("uniform"); /* Assign a random number to each obs */ 
run;

proc sort data=have; by location caseLoad rnd; run;

proc rank data=have out=ordered;
by location caseload;
var rnd;
ranks rndRank;
run;

proc sort data=ordered; by location rndRank rnd; run;

data want;
set ordered;
by location;
if first.location then count = 0;
count + 1;
if count &amp;lt;= 11;
keep id location caseload; 
run;

proc sort data=want; by location caseload id; run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Mar 2018 21:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449780#M23502</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-29T21:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselect double stratification</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449783#M23503</link>
      <description>&lt;P&gt;That works! Thank you so much. This is a great lesson for me to be wary of "tunnel vision". I focused so much on surveyselect I neglected to entertain other possible solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 21:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-double-stratification/m-p/449783#M23503</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2018-03-29T21:58:38Z</dc:date>
    </item>
  </channel>
</rss>

