<?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: Combining DataSets with Common Variables Into One in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/508417#M72897</link>
    <description>Can you post an example of what your input data looks like and what you would expect as output.</description>
    <pubDate>Mon, 29 Oct 2018 17:18:50 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-29T17:18:50Z</dc:date>
    <item>
      <title>Combining DataSets with Common Variables Into One</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/508386#M72895</link>
      <description>&lt;P&gt;Helllo!&amp;nbsp;I am a research student that is working with survey data to examine the&amp;nbsp;co-occurrence of itch with other co-morbidities. Basically, I am looking at whether or not itch presents with other&amp;nbsp;comorbidities such as PulmonaryCardiac pre- and post-survey. The following code, for example, I think, was used to delineate that:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(Pre_PulmonaryCardiac = 0 &amp;amp; Post_PulmonaryCardiac = 1) then PulmonaryCardiac = 1;&lt;BR /&gt;else if(Pre_PulmonaryCardiac = 1 &amp;amp; Post_PulmonaryCardiac = 0) then PulmonaryCardiac = 2;&lt;BR /&gt;else if(Pre_PulmonaryCardiac = 1 &amp;amp; Post_PulmonaryCardiac = 1) then PulmonaryCardiac = 3;&lt;BR /&gt;else PulmonaryCardiac = 0;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm now trying to create a combined frequency table of results to examine whether itch presented with PulmonaryCardiac regardless of whether its pre- or post-survey. In other words, I want to&amp;nbsp;&lt;SPAN&gt;develop a format that combines any patients that have any instance of a particular variable and set that to 1, if no then 0. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I am currently utilizing does not give me the right combined results:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data = ITCH.CROSS_MERGED1;&lt;BR /&gt;where&amp;nbsp;PulmonaryCardiac = 0 |&amp;nbsp;PulmonaryCardiac&amp;nbsp;= 2;&lt;BR /&gt;tables rMSA_Q_12 *&amp;nbsp;PulmonaryCardiac&amp;nbsp;/ chisq;&lt;BR /&gt;format&amp;nbsp;PulmonaryCardiac FORMAT_FOR_COMPOSITES. rMSA_Q_12 rMSA_2bin.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wrong Combines Results.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24454iD74DAAFA425BD661/image-size/large?v=v2&amp;amp;px=999" role="button" title="Wrong Combines Results.png" alt="Wrong Combines Results.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I format a code that would allow me to get frequencies for: (1) no Dx pre and post (2) Dx pre, post, whereever?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 15:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/508386#M72895</guid>
      <dc:creator>RShaw</dc:creator>
      <dc:date>2018-10-29T15:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Combining DataSets with Common Variables Into One</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/508417#M72897</link>
      <description>Can you post an example of what your input data looks like and what you would expect as output.</description>
      <pubDate>Mon, 29 Oct 2018 17:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/508417#M72897</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-29T17:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Combining DataSets with Common Variables Into One</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/509826#M72963</link>
      <description>&lt;P&gt;Not sure if that's what you want, but a format to divide the data into any/no pulmonary condition can be written like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value anyPulmonary
    0='No pulmonary condition'
    1,2,3='Pulmonary condition'
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can than apply that format to your PulmonaryCardiac variable.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-DataSets-with-Common-Variables-Into-One/m-p/509826#M72963</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-11-02T11:52:14Z</dc:date>
    </item>
  </channel>
</rss>

