<?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 Sampling Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40820#M10555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Since you are using a STRATA statement you have the option of using SAMPSIZE in the proc statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;such as SAMPSIZE = (5 5 5 2 5 5 2 5 5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The samplesize is then PER strata corresponding to the sorted order of the strata. In my exampe the 4th and 7th Strata are the ones that only have 2 samples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2012 21:04:55 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-03-22T21:04:55Z</dc:date>
    <item>
      <title>Sampling Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40818#M10553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;proc surveyselect data=SORTMARCH2012DATA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method=srs n=2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed=1979 out=MarchTrackingIDSample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata TrackingIDLength;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;I have a table of barcode scans. I am analysing the length of the barcodes scanned. The code above gives me 2 random samples for each Barcode length in the data. I would like to have 5 random samples for each Barcode length (where possible), however cannot make n=5 because there are only 2 instances of some Barcode lengths(resulting in a script failure). Does anyone know how to get around this limitation?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;Thanks for your time,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 11pt;"&gt;James&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 19:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40818#M10553</guid>
      <dc:creator>Habs4Life</dc:creator>
      <dc:date>2012-03-22T19:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sampling Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40819#M10554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this would work :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table strataSampleSizes as&lt;BR /&gt;select TrackingIDLength, min(count(*), 5) as _NSIZE_ from SORTMARCH2012DATA&lt;BR /&gt;group by TrackingIDLength;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyselect data=SORTMARCH2012DATA&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method=srs N=strataSampleSizes&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed=1979 out=MarchTrackingIDSample;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata TrackingIDLength;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG Corrected the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 20:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40819#M10554</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-03-22T20:32:50Z</dc:date>
    </item>
    <item>
      <title>Sampling Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40820#M10555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Since you are using a STRATA statement you have the option of using SAMPSIZE in the proc statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;such as SAMPSIZE = (5 5 5 2 5 5 2 5 5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The samplesize is then PER strata corresponding to the sorted order of the strata. In my exampe the 4th and 7th Strata are the ones that only have 2 samples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 21:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sampling-Question/m-p/40820#M10555</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-03-22T21:04:55Z</dc:date>
    </item>
  </channel>
</rss>

