<?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: Creating a Separate Analysis Set from Subject ID Numbers in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/819199#M34717</link>
    <description>&lt;P&gt;This did the trick - thank you very much. I just modified it to be for Tables/frequency as opposed to means.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;T.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jun 2022 19:43:41 GMT</pubDate>
    <dc:creator>SAS_Novice22</dc:creator>
    <dc:date>2022-06-20T19:43:41Z</dc:date>
    <item>
      <title>Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818075#M34584</link>
      <description>&lt;P&gt;Morning SAS Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if anyone would be willing to to guide me towards the correct steps to take. What I would like to do is look only at users who took Drug A after enrollment (I do not have a specific variable for this) but I do have a list of all subject ID numbers of those who have taken Drug A after enrollment.&lt;BR /&gt;Essentially, I would like to use these subject numbers (N=15) in order to conduct separate analyses on this group of individuals only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if I should generate new variable or use a series of if or then statements or if there is another way to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any recommendations would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;T.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 13:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818075#M34584</guid>
      <dc:creator>SAS_Novice22</dc:creator>
      <dc:date>2022-06-14T13:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818082#M34585</link>
      <description>&lt;P&gt;You could probably type the ID numbers in, but I suspect that these 15 IDs are already in some text file or spreadsheet or database or other electronic form. If that's the case, then read the text file or spreadsheet or database table and use that information to help you segregate the data to do the analysis you want.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 14:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818082#M34585</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-14T14:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818143#M34595</link>
      <description>&lt;P&gt;Just add a WHERE statement to your analysis, you can use the IN operator to test if the value in one of a list of values.&lt;/P&gt;
&lt;P&gt;So if the subject id numbers are in the character variable ID (why would an identifier by a numeric variable) then you just need something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have ;
  where id in ('101','203','405');
   var age ht wt;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2022 16:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818143#M34595</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-14T16:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818147#M34596</link>
      <description>&lt;P&gt;Assumptions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Input data set with all participants is called HAVE&lt;/LI&gt;
&lt;LI&gt;data set with list of 15 IDs who need to be included are in dataset called SELECTED&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select * from have
where ID in (Select ID from SELECTED);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works regardless if ID's are duplicated in the HAVE or SELECTED cases.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If IDs are not duplicated in any data set another method is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by ID;
proc sort data=selected;
by ID;

data want;
merge have selected(in=sel);
by ID;
if sel;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/426997"&gt;@SAS_Novice22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Morning SAS Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering if anyone would be willing to to guide me towards the correct steps to take. What I would like to do is look only at users who took Drug A after enrollment (I do not have a specific variable for this) but I do have a list of all subject ID numbers of those who have taken Drug A after enrollment.&lt;BR /&gt;Essentially, I would like to use these subject numbers (N=15) in order to conduct separate analyses on this group of individuals only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if I should generate new variable or use a series of if or then statements or if there is another way to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any recommendations would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;T.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 16:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/818147#M34596</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-14T16:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/819199#M34717</link>
      <description>&lt;P&gt;This did the trick - thank you very much. I just modified it to be for Tables/frequency as opposed to means.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;T.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 19:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/819199#M34717</guid>
      <dc:creator>SAS_Novice22</dc:creator>
      <dc:date>2022-06-20T19:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Separate Analysis Set from Subject ID Numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/819200#M34718</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;,&lt;BR /&gt;I am sure this would also work. I need to build up my skill at reading and writing code for now I went with Tom's simple code above however, I do plan to try this code out shortly.&lt;BR /&gt;Thank you again.&lt;BR /&gt;T.</description>
      <pubDate>Mon, 20 Jun 2022 19:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-Separate-Analysis-Set-from-Subject-ID-Numbers/m-p/819200#M34718</guid>
      <dc:creator>SAS_Novice22</dc:creator>
      <dc:date>2022-06-20T19:45:02Z</dc:date>
    </item>
  </channel>
</rss>

