<?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: How do I select 100 random people with all of their rows to be included? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778247#M247717</link>
    <description>Thank you so much!&lt;BR /&gt;</description>
    <pubDate>Wed, 03 Nov 2021 16:07:19 GMT</pubDate>
    <dc:creator>awardell</dc:creator>
    <dc:date>2021-11-03T16:07:19Z</dc:date>
    <item>
      <title>Proc surveyselect: How do I select 100 random people with all of their rows to be included?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778240#M247714</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset where individuals have observations across multiple rows. Patients are identified by their ID variable. Can I use proc surveyselect to randomly sample 100 of these unique IDs and then keep all of the rows that are tied to that id? It is almost like cluster sampling where the patient's ID is the cluster and we want to keep all of the individuals in that "cluster". I was having trouble finding anything like this in the documentation for proc surveyselect. If it is not possible to do with surveyselect, how can I do it using a different method (proc sql perhaps)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;This is what I've tried. I have also considered trying the selectall option, but that didn't work for me.&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc surveyselect data = data_set method = SRS
  sampsize = 100 seed = 12345 out = sample_ds;
  id _all_;
  strata id;
run;&lt;/PRE&gt;
&lt;P class="p3"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for any help you can provide!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 16:01:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778240#M247714</guid>
      <dc:creator>awardell</dc:creator>
      <dc:date>2021-11-03T16:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyselect: How do I select 100 random people with all of their rows to be included?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778243#M247716</link>
      <description>&lt;P&gt;You can use the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_018/statug/statug_surveyselect_syntax05.htm" target="_self"&gt;SAMPLINGUNIT | CLUSTER&lt;/A&gt; statement in PROC SURVEYSELECT to select patient IDs instead of observations. For example, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;samplingunit patientID;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data = data_set method = SRS
  sampsize = 100 seed = 12345 out = sample_ds;
  id _all_;
  strata sart_id;
  samplingunit patientID;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 15:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778243#M247716</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2021-11-03T15:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc surveyselect: How do I select 100 random people with all of their rows to be included?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778247#M247717</link>
      <description>Thank you so much!&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Nov 2021 16:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-surveyselect-How-do-I-select-100-random-people-with-all-of/m-p/778247#M247717</guid>
      <dc:creator>awardell</dc:creator>
      <dc:date>2021-11-03T16:07:19Z</dc:date>
    </item>
  </channel>
</rss>

