<?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 Creating a New Indicator Variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843655#M36614</link>
    <description>&lt;P&gt;I want to create an indicator variable for 'male' sex. However, I do not have gender or sex as variables in my data set. I have two different data sets (data set for males) and (data set for females). I am trying to combine the two data sets which is why I need help with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname hw6 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Desktop\Assignment 6';
data hw6.sex_f_temp(rename=(subj_id_char=number) drop=subj_id);
set hw6.sex_f;
subj_id_char = input(subj_id, 4.);
run;
proc sort data=hw6.sex_f_temp; by number; 
proc sort data=hw6.sex_m; by number;
data pbc;
set hw6.sex_f_temp hw6.sex_m; 
by number;
logALBUMIN=log(ALBUMIN);
if male = 1 then sex = 1;
if female = 1 then sex=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Thu, 10 Nov 2022 18:08:43 GMT</pubDate>
    <dc:creator>MisterJenn</dc:creator>
    <dc:date>2022-11-10T18:08:43Z</dc:date>
    <item>
      <title>Creating a New Indicator Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843655#M36614</link>
      <description>&lt;P&gt;I want to create an indicator variable for 'male' sex. However, I do not have gender or sex as variables in my data set. I have two different data sets (data set for males) and (data set for females). I am trying to combine the two data sets which is why I need help with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname hw6 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Desktop\Assignment 6';
data hw6.sex_f_temp(rename=(subj_id_char=number) drop=subj_id);
set hw6.sex_f;
subj_id_char = input(subj_id, 4.);
run;
proc sort data=hw6.sex_f_temp; by number; 
proc sort data=hw6.sex_m; by number;
data pbc;
set hw6.sex_f_temp hw6.sex_m; 
by number;
logALBUMIN=log(ALBUMIN);
if male = 1 then sex = 1;
if female = 1 then sex=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843655#M36614</guid>
      <dc:creator>MisterJenn</dc:creator>
      <dc:date>2022-11-10T18:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Indicator Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843657#M36615</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pbc;
set hw6.sex_f_temp(in=f) hw6.sex_m(in=m); 
by number;
if f then sex='F';
else if m then sex='M';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843657#M36615</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-10T18:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Indicator Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843662#M36616</link>
      <description>&lt;P&gt;If the idea is to add an indicator based on the source data set use the data set option IN. In creates a 1/0 temporary variable that indicates the current record comes from a given set (1) or not (0). So you can perform any conditional calculations you need to set such things. Below is very generic example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
    set dataset1 (in=inset1)
         dataset2 (in= inset2)
   ;
   if inset1 then indicator = 1;
   else if inset2 then indicator=0;
  /* or what ever variable /values you want to set*/
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843662#M36616</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-10T18:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Indicator Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843932#M36643</link>
      <description>&lt;P&gt;unrelated but when getting the log of albumin you should probably only do that when albumin is &amp;gt; 0.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 15:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-New-Indicator-Variable/m-p/843932#M36643</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-12T15:56:53Z</dc:date>
    </item>
  </channel>
</rss>

