<?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 PROC LOGISITIC, assigning a reference in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776791#M38051</link>
    <description>&lt;P&gt;Outcome of interest is any complications within 30 days of surgery.&lt;/P&gt;
&lt;P&gt;Predictors include patient and disease characteristics, almost all of which are binary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Creating dummy variables*/
data ga_1;
set groin;
/*OUTCOME: any complications*/
if comp ^= 'yes' then comp_num = 1;
else if comp = 'yes' then comp_num = 2;
else if comp = . then comp_num = 3;
label comp_num = 'Any complications categorical';

/*PREDICTOR: age*/
age = round((sx_date - birthdate)/365, 2.);
label age = 'Age at surgery';
/*PREDICTOR: sex*/
if sex = 'M' then sex_num = 1;
else if sex = 'F' then sex_num = 2;
label sex_num = 'Sex';
/*PREDICTOR: smoker*/
if smoker = 'no' then smoker_num = 1;
else if smoker = 'yes' then smoker_num = 2;
else if smoker = . then smoker_num = 3;
label smoker_num = 'Smoker categorical';
/*PREDICTOR: cardiac disease*/
if card_dis = 'no' then card_num = 1;
else if card_dis ='yes' then card_num = 2;
else if card_dis = . then card_num = 3;
label card_num = 'Cardiac/vascular categorical';run; 


proc format;
value sex 1 = 'Male' 2 = 'Female';

value smoker 1 = 'N' 2 = 'P' 3 = 'Missing';
value card_dis 1 = 'N' 2 = 'P' 3 = 'Missing';

value comp 1 = 'no' 2 = 'yes' 3 = 'Missing';

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to make a non-smoker (SMOKER = NO) as the reference, but it's not working out as I'd hope it to. I'd like to see the OR between non smoker and smoker.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data = ga_2 descending;/
class sex_num (param = ref ref = first)
smoker_num (param = ref ref = first)
 card_num (param = ref ref = first)

model comp_num (event = '1') = age sex_num
smoker_num   card_num

/ clodds = wald orpvalue;
output out = out p = new;
format sex_num sex.
smoker_num smoker.  card_num card_dis.

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deengyn_0-1635350953166.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65093i36710C480015DF42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deengyn_0-1635350953166.png" alt="deengyn_0-1635350953166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2021 16:09:38 GMT</pubDate>
    <dc:creator>deengyn</dc:creator>
    <dc:date>2021-10-27T16:09:38Z</dc:date>
    <item>
      <title>PROC LOGISITIC, assigning a reference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776791#M38051</link>
      <description>&lt;P&gt;Outcome of interest is any complications within 30 days of surgery.&lt;/P&gt;
&lt;P&gt;Predictors include patient and disease characteristics, almost all of which are binary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Creating dummy variables*/
data ga_1;
set groin;
/*OUTCOME: any complications*/
if comp ^= 'yes' then comp_num = 1;
else if comp = 'yes' then comp_num = 2;
else if comp = . then comp_num = 3;
label comp_num = 'Any complications categorical';

/*PREDICTOR: age*/
age = round((sx_date - birthdate)/365, 2.);
label age = 'Age at surgery';
/*PREDICTOR: sex*/
if sex = 'M' then sex_num = 1;
else if sex = 'F' then sex_num = 2;
label sex_num = 'Sex';
/*PREDICTOR: smoker*/
if smoker = 'no' then smoker_num = 1;
else if smoker = 'yes' then smoker_num = 2;
else if smoker = . then smoker_num = 3;
label smoker_num = 'Smoker categorical';
/*PREDICTOR: cardiac disease*/
if card_dis = 'no' then card_num = 1;
else if card_dis ='yes' then card_num = 2;
else if card_dis = . then card_num = 3;
label card_num = 'Cardiac/vascular categorical';run; 


proc format;
value sex 1 = 'Male' 2 = 'Female';

value smoker 1 = 'N' 2 = 'P' 3 = 'Missing';
value card_dis 1 = 'N' 2 = 'P' 3 = 'Missing';

value comp 1 = 'no' 2 = 'yes' 3 = 'Missing';

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to make a non-smoker (SMOKER = NO) as the reference, but it's not working out as I'd hope it to. I'd like to see the OR between non smoker and smoker.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data = ga_2 descending;/
class sex_num (param = ref ref = first)
smoker_num (param = ref ref = first)
 card_num (param = ref ref = first)

model comp_num (event = '1') = age sex_num
smoker_num   card_num

/ clodds = wald orpvalue;
output out = out p = new;
format sex_num sex.
smoker_num smoker.  card_num card_dis.

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deengyn_0-1635350953166.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65093i36710C480015DF42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deengyn_0-1635350953166.png" alt="deengyn_0-1635350953166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 16:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776791#M38051</guid>
      <dc:creator>deengyn</dc:creator>
      <dc:date>2021-10-27T16:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LOGISITIC, assigning a reference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776796#M38052</link>
      <description>Remove REF=FIRST after SMOKER_NUM in your CLASS statement, or change it to explicitly specify a reference level, such as REF="N". Note that the formatted value is specified, not the internal, numeric value.</description>
      <pubDate>Wed, 27 Oct 2021 16:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776796#M38052</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-10-27T16:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LOGISITIC, assigning a reference</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776798#M38053</link>
      <description>&lt;P&gt;In SAS, missing is the lowest so is the first technically.&lt;/P&gt;
&lt;P&gt;You'll need to set the reference to the No value, using the formatted value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;class sex_num ( ref = first)
smoker_num ( ref = 'N')
 card_num (ref = first) / param=ref;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;FYI - your code has some syntax errors such as missing semicolons but I'm assuming this is just an example and not your actual code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/326508"&gt;@deengyn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Outcome of interest is any complications within 30 days of surgery.&lt;/P&gt;
&lt;P&gt;Predictors include patient and disease characteristics, almost all of which are binary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Creating dummy variables*/
data ga_1;
set groin;
/*OUTCOME: any complications*/
if comp ^= 'yes' then comp_num = 1;
else if comp = 'yes' then comp_num = 2;
else if comp = . then comp_num = 3;
label comp_num = 'Any complications categorical';

/*PREDICTOR: age*/
age = round((sx_date - birthdate)/365, 2.);
label age = 'Age at surgery';
/*PREDICTOR: sex*/
if sex = 'M' then sex_num = 1;
else if sex = 'F' then sex_num = 2;
label sex_num = 'Sex';
/*PREDICTOR: smoker*/
if smoker = 'no' then smoker_num = 1;
else if smoker = 'yes' then smoker_num = 2;
else if smoker = . then smoker_num = 3;
label smoker_num = 'Smoker categorical';
/*PREDICTOR: cardiac disease*/
if card_dis = 'no' then card_num = 1;
else if card_dis ='yes' then card_num = 2;
else if card_dis = . then card_num = 3;
label card_num = 'Cardiac/vascular categorical';run; 


proc format;
value sex 1 = 'Male' 2 = 'Female';

value smoker 1 = 'N' 2 = 'P' 3 = 'Missing';
value card_dis 1 = 'N' 2 = 'P' 3 = 'Missing';

value comp 1 = 'no' 2 = 'yes' 3 = 'Missing';

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to make a non-smoker (SMOKER = NO) as the reference, but it's not working out as I'd hope it to. I'd like to see the OR between non smoker and smoker.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data = ga_2 descending;/
class sex_num (param = ref ref = first)
smoker_num (param = ref ref = first)
 card_num (param = ref ref = first)

model comp_num (event = '1') = age sex_num
smoker_num   card_num

/ clodds = wald orpvalue;
output out = out p = new;
format sex_num sex.
smoker_num smoker.  card_num card_dis.

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deengyn_0-1635350953166.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65093i36710C480015DF42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deengyn_0-1635350953166.png" alt="deengyn_0-1635350953166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 16:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-LOGISITIC-assigning-a-reference/m-p/776798#M38053</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-27T16:24:45Z</dc:date>
    </item>
  </channel>
</rss>

