<?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: Creating a reference group from unexposed subjects and finding its odds ratio in logistic regres in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676852#M32443</link>
    <description>Thanks very much Steve for your in-depth explanation.&lt;BR /&gt;I have posted another question which looks similar to what you answered.&lt;BR /&gt;ak.</description>
    <pubDate>Fri, 14 Aug 2020 19:32:15 GMT</pubDate>
    <dc:creator>ak2011</dc:creator>
    <dc:date>2020-08-14T19:32:15Z</dc:date>
    <item>
      <title>Creating a reference group from unexposed subjects and finding its odds ratio in logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676411#M32418</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would appreciate if someone could provide me with a better approach to solve this problem:&lt;/P&gt;
&lt;P&gt;Creating a reference group(refgroup) from unexposed subjects(ids) and finding the odds ratio for the refgroup using logistic model&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My main aims are thus are to&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Count the number of cases(ca case) and controls (pop cont) not exposed to any of the the 4 agents (a1, a2,a3 and a4 ) from the dataset agents_expt (Table 1) below. Exposed is 1 and unexposed is zero (0).&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Results: 3 ca cases and 7 pop cont obtained(Table 2). -Step 1 of SAS code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b.Create/name the results obtained in Table 2(ie. subjects unexposed to any of the agents as a refgroup for the purpose of comparison.-Step 2 of SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, I would need help here: SAS created 2 refgroups(0,1) which I think is incorrect. The refgroup should be for subjects unexposed to any agents only; i.e. only 1 refgroup should be created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Find the estimate (odds ratio) for the refgroup.-step 3 of SAS code.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Specifically, I would like SAS to find the odds ratio for the refgroup (i.e. subjects unexposed to any of the agents) only (i.e.only 1 refgroup) using logistic regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, I would need the correct SAS code to solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;My dataset, code and log are found below; results are attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for your expertise.&lt;/P&gt;
&lt;P&gt;ak.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;/* Logistic test ref group test*/&lt;BR /&gt; data agents_expt;&lt;BR /&gt;input id$ a1 a2 a3 a4  lung$ 14-21 income 23-29;&lt;BR /&gt;datalines;&lt;BR /&gt;os1  1 0 0 1 ca case  45424&lt;BR /&gt;os2  1 1 0 0 ca case  52877&lt;BR /&gt;os3  0 0 0 0 pop cont 25600 &lt;BR /&gt;os4  1 0 0 1 pop cont 14888&lt;BR /&gt;os5  0 0 0 0 ca case  41036&lt;BR /&gt;os6  0 0 0 0 ca case  20365&lt;BR /&gt;os7  1 0 1 1 pop cont 16988&lt;BR /&gt;os8  0 0 0 0 ca case  100962&lt;BR /&gt;os9 1 0 1 0  pop cont 11230&lt;BR /&gt;os10 0 0 1 0 ca case  35850&lt;BR /&gt;os11 0 1 0 0 pop cont 28700&lt;BR /&gt;os12 0 0 0 0 pop cont 46320&lt;BR /&gt;os13 1 1 1 1 pop cont  24897&lt;BR /&gt;os14 0 0 0 0 pop cont  18966&lt;BR /&gt;os15 1 0 0 1 ca case  20540&lt;BR /&gt;os16 0 0 1 0 pop cont 150600&lt;BR /&gt;os17 1 1 1 1 pop cont  24897&lt;BR /&gt;os18 0 0 0 0 pop cont  17999&lt;BR /&gt;os19 0 0 0 0 pop cont  22540&lt;BR /&gt;os20 0 0 0 0 pop cont 158600&lt;BR /&gt;os21 0 0 0 0 pop cont 187365&lt;BR /&gt;os22 1 0 1 0 ca case  30580&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc print data=agents_expt;&lt;BR /&gt;Title 'Table 1: Exposure of ids to 4 agents';&lt;BR /&gt;&lt;BR /&gt;  /*Step 1: Finding number of cases and controls unexposed to agents(a1,a2,a3 and a4)*/  &lt;BR /&gt;proc freq data=agents_expt(where=(sum(a1,a2,a3,a4)=0));&lt;BR /&gt;     tables lung;&lt;BR /&gt;title 'Table 2:Subjects unexposed to any of the 4 agents';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/*Step 2:Using subjects unexposed to any of agents as a ref. group*/&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table t as &lt;BR /&gt;  select&lt;BR /&gt;    id, a1, a2, a3,a4,lung, income,&lt;BR /&gt;    sum(a1,a2,a3,a4)=0 as refgroup&lt;BR /&gt;     from agents_expt&lt;BR /&gt;     ;&lt;BR /&gt;     quit;&lt;BR /&gt;     &lt;BR /&gt;   proc print data=t; &lt;BR /&gt;   title 'Table 3: original variables and ref group';&lt;BR /&gt;   run;&lt;BR /&gt;   &lt;BR /&gt;    proc freq data=t;&lt;BR /&gt;    tables lung* refgroup;&lt;BR /&gt;    title 'Table 4: freq of ca case and pop cont for ref group';&lt;BR /&gt;    run;&lt;BR /&gt;&lt;BR /&gt;/*Step 3: Finding odds ratio estimates for variables including ref.group*/ &lt;BR /&gt;&lt;BR /&gt;/* LOGISTIC REG. TEST*/&lt;BR /&gt;data logtest; set t;&lt;BR /&gt;if lung in ('ca case','pop cont');&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt; proc logistic data=logtest;&lt;BR /&gt;model lung(event='ca case') =refgroup;  &lt;BR /&gt;Title 'Table 5: Estimates for ref. group';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;DIV&gt;
&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;72&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;73 /* Logistic test ref group test*/&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="sasSource"&gt;74 data agents_expt;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;75 input id$ a1 a2 a3 a4 lung$ 14-21 income 23-29;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;76 datalines;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote1_1597300489747" class="sasNote"&gt;NOTE: The data set WORK.AGENTS_EXPT has 22 observations and 7 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote2_1597300489747" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;99 ;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;100 run;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;101&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;102&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;103 proc print data=agents_expt;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;104 Title 'Table 1: Exposure of ids to 4 agents';&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;105&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;106 /*Step 1: Finding number of cases and controls unexposed to agents(a1,a2,a3 and a4)*/&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote3_1597300489747" class="sasNote"&gt;NOTE: There were 22 observations read from the data set WORK.AGENTS_EXPT.&lt;/DIV&gt;
&lt;DIV id="sasLogNote4_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.48 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.47 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;107 proc freq data=agents_expt(where=(sum(a1,a2,a3,a4)=0));&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;108 tables lung;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;109 title 'Table 2:Subjects unexposed to any of the 4 agents';&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;110 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote5_1597300489747" class="sasNote"&gt;NOTE: There were 10 observations read from the data set WORK.AGENTS_EXPT.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;WHERE SUM(a1, a2, a3, a4)=0;&lt;/DIV&gt;
&lt;DIV id="sasLogNote6_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.18 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.17 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;111&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;112 /*Step 2:Using subjects unexposed to any of agents as a ref. group*/&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;113&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;114 proc sql;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;115 create table t as&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;116 select&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;117 id, a1, a2, a3,a4,lung, income,&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;118 sum(a1,a2,a3,a4)=0 as refgroup&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;119 from agents_expt&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;120 ;&lt;/DIV&gt;
&lt;DIV id="sasLogNote7_1597300489747" class="sasNote"&gt;NOTE: Table WORK.T created, with 22 rows and 8 columns.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;121 quit;&lt;/DIV&gt;
&lt;DIV id="sasLogNote8_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.02 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;122&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;123 proc print data=t;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;124 title 'Table 3: original variables and ref group';&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;125 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote9_1597300489747" class="sasNote"&gt;NOTE: There were 22 observations read from the data set WORK.T.&lt;/DIV&gt;
&lt;DIV id="sasLogNote10_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.26 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.24 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;126&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;127 proc freq data=t;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;128 tables lung* refgroup;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;129 title 'Table 4: freq of ca case and pop cont for ref group';&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;130 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote11_1597300489747" class="sasNote"&gt;NOTE: There were 22 observations read from the data set WORK.T.&lt;/DIV&gt;
&lt;DIV id="sasLogNote12_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.25 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.23 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;131&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;132 /*Step 3: Finding odds ratio estimates for variables including ref.group*/&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;133&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;134 /* LOGISTIC REG. TEST*/&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;135 data logtest; set t;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;136 if lung in ('ca case','pop cont');&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;137 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote13_1597300489747" class="sasNote"&gt;NOTE: There were 22 observations read from the data set WORK.T.&lt;/DIV&gt;
&lt;DIV id="sasLogNote14_1597300489747" class="sasNote"&gt;NOTE: The data set WORK.LOGTEST has 22 observations and 8 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote15_1597300489747" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;138&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;139 proc logistic data=logtest;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;140 model lung(event='ca case') =refgroup;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;141 Title 'Table 5: Estimates for ref. group';&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;142 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote16_1597300489747" class="sasNote"&gt;NOTE: PROC LOGISTIC is modeling the probability that lung='ca case'.&lt;/DIV&gt;
&lt;DIV id="sasLogNote17_1597300489747" class="sasNote"&gt;NOTE: Convergence criterion (GCONV=1E-8) satisfied.&lt;/DIV&gt;
&lt;DIV id="sasLogNote18_1597300489747" class="sasNote"&gt;NOTE: There were 22 observations read from the data set WORK.LOGTEST.&lt;/DIV&gt;
&lt;DIV id="sasLogNote19_1597300489747" class="sasNote"&gt;NOTE: PROCEDURE LOGISTIC used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.56 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.51 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;143&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;144 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;156&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE id="pre_sasLog_55" class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 06:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676411#M32418</guid>
      <dc:creator>ak2011</dc:creator>
      <dc:date>2020-08-13T06:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a reference group from unexposed subjects and finding its odds ratio in logistic regres</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676450#M32420</link>
      <description>&lt;P&gt;When you say the odds ratio for the refgroup, I don't understand.&amp;nbsp; That is what PROC LOGISTIC is giving (well at least the log odds ratio).&amp;nbsp; It is the ratio of the odds of being in ca_case given the observation is in refgroup=0 to the odds of being in ca_case given the observation is in refgroup=1. If you restrict the analysis to only the unexposed ids, you can calculate the odds of the response, but there is no other classification to use to calculate an odds &lt;U&gt;&lt;STRONG&gt;ratio&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Maybe I am just dense this morning and not catching on to what you want to do.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 11:29:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676450#M32420</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-08-13T11:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a reference group from unexposed subjects and finding its odds ratio in logistic regres</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676575#M32423</link>
      <description>Thank you Steve and sorry for the confusion. Fact is I would like to restrict the analysis to only the unexposed ids. Is there a way I can do it?&lt;BR /&gt;Thank you.&lt;BR /&gt;ak.</description>
      <pubDate>Thu, 13 Aug 2020 18:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676575#M32423</guid>
      <dc:creator>ak2011</dc:creator>
      <dc:date>2020-08-13T18:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a reference group from unexposed subjects and finding its odds ratio in logistic regres</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676588#M32424</link>
      <description>&lt;P&gt;Well, then perhaps running the analysis by refgroup can yield something.&amp;nbsp; I have to remove refgroup from the model statement under this scenario. The log then looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;79   proc logistic data=logtest;
80    by refgroup;
81   model lung(event='ca case') = /clodds=both;
82   Title 'Table 5: Estimates for ref. group';
83   run;

NOTE: No explanatory variables have been specified.
NOTE: PROC LOGISTIC is modeling the probability that lung='ca case'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following BY group:
      refgroup=0
NOTE: PROC LOGISTIC is modeling the probability that lung='ca case'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following BY group:
      refgroup=1
NOTE: There were 22 observations read from the data set WORK.LOGTEST.
&lt;/PRE&gt;
&lt;P&gt;I get an intercept for each of the models.&amp;nbsp; For refgroup 0, it is -0.3365, for refgroup 1 it is -0.8473.&amp;nbsp; Exponentiating these give 0.7124... for refgroup 0, and 0.42857...&lt;/P&gt;
&lt;P&gt;for refgroup 2.&amp;nbsp; These are just the ratios of cases to controls for each of the reference groups.&amp;nbsp; No need for PROC LOGISTIC in this case, and perhaps just as important, there are no odds ratios within each refgroup.&amp;nbsp; There are odds - not odds ratios.&amp;nbsp; The intercept is on the log odds scale.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you have another variable in the dataset - income.&amp;nbsp; You &lt;EM&gt;could&amp;nbsp;&lt;/EM&gt;calculate the odds ratio for some change in income.&amp;nbsp; For this exercise, let's set that change at 1000.&amp;nbsp; Then your code would look something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=logtest;&lt;BR /&gt;by refgroup;&lt;BR /&gt;model lung(event='ca case') = income /clodds=both; &lt;BR /&gt;units income=1000;&lt;BR /&gt;run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If you run this, you will find the OR in both refgroups is really close to 1, meaning that an increase or decrease in income of $1000 has essentially no effect on the incidence rate within a refgroup..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One last try. Now lets put both refgroups and income, as well as any interaction, in the model.&amp;nbsp; Since one is continuous and the other categorical, there are some changes;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=logtest;
class refgroup;
model lung(event='ca case') =refgroup income refgroup*income ;  
oddsratio refgroup/at (income = 20000 to 200000 by 20000);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;And now you see an increase in the OR as income increases.&amp;nbsp; However, the confidence bounds seem to grow even faster, thus reflecting the maximum likelihood tests that found no significant factors in the model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 19:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676588#M32424</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-08-13T19:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a reference group from unexposed subjects and finding its odds ratio in logistic regres</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676852#M32443</link>
      <description>Thanks very much Steve for your in-depth explanation.&lt;BR /&gt;I have posted another question which looks similar to what you answered.&lt;BR /&gt;ak.</description>
      <pubDate>Fri, 14 Aug 2020 19:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-reference-group-from-unexposed-subjects-and-finding/m-p/676852#M32443</guid>
      <dc:creator>ak2011</dc:creator>
      <dc:date>2020-08-14T19:32:15Z</dc:date>
    </item>
  </channel>
</rss>

