<?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: create composite variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244839#M268539</link>
    <description>&lt;P&gt;Yes, what your logic ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if both of them are diecard then discard =1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;if any one of them is dicard then discard=1&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2016 21:58:00 GMT</pubDate>
    <dc:creator>mohamed_zaki</dc:creator>
    <dc:date>2016-01-20T21:58:00Z</dc:date>
    <item>
      <title>create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244827#M268535</link>
      <description>&lt;P&gt;I have a dataset related to kidney transplants and each donor has a donor id and both the left and right kidneys are tied to that donor id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a binary variable called 'discard' (0=no, 1=yes) that is a composite of left and right kidney dispositions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have the variables:&lt;/P&gt;&lt;P&gt;donor_id&lt;/P&gt;&lt;P&gt;r_disp (5=discard, 6=transplant)&lt;/P&gt;&lt;P&gt;l_disp (5=discard, 6=transplant)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I create a variable called "discard" that will be a composite indicator of r_disp and l_disp so that I can investigate the odds of discard overall?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244827#M268535</guid>
      <dc:creator>grayskillen</dc:creator>
      <dc:date>2016-01-20T21:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244831#M268536</link>
      <description>&lt;P&gt;If r_disp and l_disp are on the same record in a data step:&lt;/P&gt;
&lt;P&gt;(flag if either are discarded)&lt;/P&gt;
&lt;P&gt;discard = (r_disp=5 or l_disp=5);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(flag if BOTH are discarded)&lt;/P&gt;
&lt;P&gt;discard = (r_disp=5&amp;nbsp;and l_disp=5);&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244831#M268536</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-20T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244832#M268537</link>
      <description>&lt;P&gt;Could you give example of the data you have ?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244832#M268537</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-20T21:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244838#M268538</link>
      <description>A single observation will show data for the following variables (among others):&lt;BR /&gt;&lt;BR /&gt;Donor_id&lt;BR /&gt;r_disp (fate of right kidney)&lt;BR /&gt;L_disp (fate of left kidney)&lt;BR /&gt;Kdri (measure of kidney quality)&lt;BR /&gt;&lt;BR /&gt;Donor_id is the index variable.&lt;BR /&gt;&lt;BR /&gt;I want to run a proc logistic to investigate the odds of discard but I only have discard data by left and right. So I need to combine them someone into one discard variable for analysis.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244838#M268538</guid>
      <dc:creator>grayskillen</dc:creator>
      <dc:date>2016-01-20T21:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244839#M268539</link>
      <description>&lt;P&gt;Yes, what your logic ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if both of them are diecard then discard =1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;if any one of them is dicard then discard=1&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244839#M268539</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-20T21:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244840#M268540</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data have ;
input ID r_disp l_disp;
cards;
111 5 5
112 6 6
113 5 6
114 6 6
;
run;

data want ;
set have;
if r_disp=5 and l_disp=5 then discard=1;
else discard =0;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is example.&lt;/P&gt;
&lt;P&gt;If you want discard to equal 1 if the right &lt;STRONG&gt;or&lt;/STRONG&gt; the left is discard then change the "&lt;STRONG&gt;and&lt;/STRONG&gt;" to "&lt;STRONG&gt;or&lt;/STRONG&gt;" in the IF condition.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 22:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/244840#M268540</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-20T22:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: create composite variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/245213#M268541</link>
      <description>&lt;P&gt;The logic of discard or not isn't clear but something like this seems right:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input ID$ r_disp$ l_disp$;&lt;BR /&gt;cards;&lt;BR /&gt;1 5 5&lt;BR /&gt;2 5 6&lt;BR /&gt;3 6 5&lt;BR /&gt;4 6 6&lt;BR /&gt;;run;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;if r_disp = '6' or l_disp = '6' then Discard = '0';&lt;BR /&gt;else discard = '1';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-composite-variable/m-p/245213#M268541</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-21T15:55:15Z</dc:date>
    </item>
  </channel>
</rss>

