<?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 Sub-setting and Combining datasets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38297#M9798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for yuor responses to my query, they are much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further clarification: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my first problem I basically want to extract the name of patients for ( variable name is lets say "name")&amp;nbsp; which a specific predictor is missing (lets say variable named "score").&lt;/P&gt;&lt;P&gt;In my second problem the study was conducted at two different time points at time point one patient response is y1 and predictor variables measured were&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; x11, x21, x31, z and at tiem point two the patient response is y2 and predictor variables measured were x12,x22,x32,x42,z. Please see z stands fro the predictor variables which doesnt change with time and the variables starting with x change with time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to conduct a repeated measure analysis (my response is binary) by combining the two responses at 2 different time points&amp;nbsp; (y1 and y2) for each patient and hence the need for merging the two data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Nov 2011 13:35:21 GMT</pubDate>
    <dc:creator>Statooed</dc:creator>
    <dc:date>2011-11-01T13:35:21Z</dc:date>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38294#M9795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would really appreciate if someone can help me with the following issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have a data set with a response variable and about 40 predictor variables. I am trying to extract the response as well as soem other predictor values for&amp;nbsp; which a specific predictor is missing. How do I code it?&lt;/LI&gt;&lt;LI&gt;I have two data sets each with response and predictor variables (number of predictors is not same in both data). If I want to combine the two data as below what do I do?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data 1: y1, x11, x21, x31, z&lt;/P&gt;&lt;P&gt;Data 2: y2, x12,x22,x32,x42,z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: z stands for&amp;nbsp; predictor with same values for response in both dataset&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 15:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38294#M9795</guid>
      <dc:creator>Statooed</dc:creator>
      <dc:date>2011-10-31T15:10:12Z</dc:date>
    </item>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38295#M9796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your first question is easy to answer.&amp;nbsp; Your second gets more complex as one doesn't know the rules you want to follow for joining the two files.&amp;nbsp; Here is an example that MIGHT answer both questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input y1 x11 x21 x31 z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 1 1 1 1&lt;/P&gt;&lt;P&gt;2 2 2 . 2&lt;/P&gt;&lt;P&gt;3 3 3 3 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data two;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input y2 x12 x22 x32 x42 z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 4 4 4 4 1&lt;/P&gt;&lt;P&gt;2 5 5 . 5 2&lt;/P&gt;&lt;P&gt;3 6 6 6 6 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want_one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set one (where=(missing(x31)));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want_two as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*, b.x12,b.x22,b.x32,b.x42&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from one as a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join two as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.y1=b.y2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 15:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38295#M9796</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-31T15:29:20Z</dc:date>
    </item>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38296#M9797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your post is ambiguous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which variable is response variable? Y1,Y2 or Z?&lt;/P&gt;&lt;P&gt;"extract the response as well as soem other predictor values for&amp;nbsp; which a specific predictor is missing"&lt;/P&gt;&lt;P&gt;what do you want? Only want those obs which has non-missing response variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"if I want to combine the two data as below what do I do?"&lt;/P&gt;&lt;P&gt;You can code like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set data1 data2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you think Y1 and Y2 is different response variable.&lt;/P&gt;&lt;P&gt;Otherwise, You need to rename these both variables to have the same variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 03:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38296#M9797</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-01T03:36:46Z</dc:date>
    </item>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38297#M9798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for yuor responses to my query, they are much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further clarification: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my first problem I basically want to extract the name of patients for ( variable name is lets say "name")&amp;nbsp; which a specific predictor is missing (lets say variable named "score").&lt;/P&gt;&lt;P&gt;In my second problem the study was conducted at two different time points at time point one patient response is y1 and predictor variables measured were&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; x11, x21, x31, z and at tiem point two the patient response is y2 and predictor variables measured were x12,x22,x32,x42,z. Please see z stands fro the predictor variables which doesnt change with time and the variables starting with x change with time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to conduct a repeated measure analysis (my response is binary) by combining the two responses at 2 different time points&amp;nbsp; (y1 and y2) for each patient and hence the need for merging the two data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38297#M9798</guid>
      <dc:creator>Statooed</dc:creator>
      <dc:date>2011-11-01T13:35:21Z</dc:date>
    </item>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38298#M9799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand what you mean correctly.&lt;/P&gt;&lt;P&gt;For first question. You can code like:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; if missing(score);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For second question.can code like:(Assuming variables like x11 x21 x31 x41 ....&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; one by one increase 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data one;
&amp;nbsp; input y1 x11 x21 x31 z;
&amp;nbsp; cards;
1 1 1 1 1
2 2 2 . 2
3 3 3 3 3
;
run;

data two;
&amp;nbsp; input y2 x12 x22 x32 x42 z;
&amp;nbsp; cards;
1 4 4 4 4 1
2 5 5 . 5 2
3 6 6 6 6 6
;
run;
*make z is the first variable;
data one;retain z;set one;run;
data two;retain z;set two;run;
*union two tables as the order of variables;
proc sql;
create table want as
 select * from one
 union all
 select * from two;
quit;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 02:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38298#M9799</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-02T02:26:36Z</dc:date>
    </item>
    <item>
      <title>Sub-setting and Combining datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38299#M9800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 02:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sub-setting-and-Combining-datasets/m-p/38299#M9800</guid>
      <dc:creator>Statooed</dc:creator>
      <dc:date>2011-11-03T02:04:35Z</dc:date>
    </item>
  </channel>
</rss>

