<?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 Exact logistic regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349161#M18311</link>
    <description>&lt;PRE class="tw-data-text tw-ta tw-text-small"&gt;&lt;SPAN&gt;Hi, &lt;BR /&gt;I want to perform &lt;STRONG&gt;exact&lt;/STRONG&gt; logistic regression in SAS. I've found the following code that I want to apply to different samples of varying size.
(I use the university edition. )&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE=REFFILE&lt;BR /&gt; DBMS=DBF&lt;BR /&gt; OUT=WORK.IMPORT;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc logistic data = WORK.IMPORT desc;&lt;BR /&gt; model y = x1 x2;&lt;BR /&gt; exact x1 x2 / estimate = both;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this code I get empty tables with no estimates...
Must the data be written in a specific way, in that case, how? 

I can perform ordinary logistic regression on the samples, and my goal is to compare the results.&lt;BR /&gt;&lt;BR /&gt;I have attached the three files, log, results and data - that contains 20 observations. Because the files did not have the valid extension they are all in paint, sorry for that.&lt;BR /&gt;&lt;BR /&gt;I'm grateful for all the help I can get.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13696i4B45A68578A9A007/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="data.png" title="data.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13697iC005F8B607BA09A1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Empty_Results_ Test_log_regr.png" title="Empty_Results_ Test_log_regr.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13698i671954EA5810802C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Logg.png" title="Logg.png" /&gt;</description>
    <pubDate>Tue, 11 Apr 2017 15:18:59 GMT</pubDate>
    <dc:creator>gretaolsson</dc:creator>
    <dc:date>2017-04-11T15:18:59Z</dc:date>
    <item>
      <title>Exact logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349161#M18311</link>
      <description>&lt;PRE class="tw-data-text tw-ta tw-text-small"&gt;&lt;SPAN&gt;Hi, &lt;BR /&gt;I want to perform &lt;STRONG&gt;exact&lt;/STRONG&gt; logistic regression in SAS. I've found the following code that I want to apply to different samples of varying size.
(I use the university edition. )&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE=REFFILE&lt;BR /&gt; DBMS=DBF&lt;BR /&gt; OUT=WORK.IMPORT;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc logistic data = WORK.IMPORT desc;&lt;BR /&gt; model y = x1 x2;&lt;BR /&gt; exact x1 x2 / estimate = both;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this code I get empty tables with no estimates...
Must the data be written in a specific way, in that case, how? 

I can perform ordinary logistic regression on the samples, and my goal is to compare the results.&lt;BR /&gt;&lt;BR /&gt;I have attached the three files, log, results and data - that contains 20 observations. Because the files did not have the valid extension they are all in paint, sorry for that.&lt;BR /&gt;&lt;BR /&gt;I'm grateful for all the help I can get.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13696i4B45A68578A9A007/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="data.png" title="data.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13697iC005F8B607BA09A1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Empty_Results_ Test_log_regr.png" title="Empty_Results_ Test_log_regr.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13698i671954EA5810802C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Logg.png" title="Logg.png" /&gt;</description>
      <pubDate>Tue, 11 Apr 2017 15:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349161#M18311</guid>
      <dc:creator>gretaolsson</dc:creator>
      <dc:date>2017-04-11T15:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exact logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349319#M18316</link>
      <description>Do I need to give more information to get any help?</description>
      <pubDate>Wed, 12 Apr 2017 05:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349319#M18316</guid>
      <dc:creator>gretaolsson</dc:creator>
      <dc:date>2017-04-12T05:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Exact logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349346#M18317</link>
      <description>&lt;P&gt;Post your data in the form of a data step, most people in here dont want to download files &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 08:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349346#M18317</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-12T08:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Exact logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349362#M18319</link>
      <description>&lt;P&gt;My Data:&lt;BR /&gt;y x1 x2&lt;BR /&gt;1. 1 1.489611900786800 -0.486983894512530&lt;BR /&gt;2. 1 0.887638190472230 -0.899961461187430&lt;BR /&gt;3. 1 -0.328400349680380 0.320480850960210&lt;BR /&gt;4. 0 -1.283346136073470 0.314729922388780&lt;BR /&gt;5. 1 -0.014384666024895 -1.040793737862780&lt;BR /&gt;6. 1 1.005337941612940 0.385444205622100&lt;BR /&gt;7. 1 0.403112850999760 0.797554772638080&lt;BR /&gt;8. 1 1.432508077938930 -0.553701810045310&lt;BR /&gt;9. 1 0.137341139238340 0.177313212434980&lt;BR /&gt;10. 0 -1.341507064615280 0.042985039337917&lt;/P&gt;&lt;P&gt;Logg:&lt;BR /&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;61&lt;BR /&gt;62 PROC IMPORT DATAFILE=REFFILE&lt;BR /&gt;63 DBMS=DBF&lt;BR /&gt;64 OUT=WORK.IMPORT1;&lt;BR /&gt;65 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: Import cancelled. Output dataset WORK.IMPORT1 already exists. Specify REPLACE option to overwrite it.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;66&lt;BR /&gt;67&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;68 proc logistic data = WORK.IMPORT1;&lt;BR /&gt;69 model y = x1 x2;&lt;BR /&gt;70 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROC LOGISTIC is modeling the probability that y=0. One way to change this to model the probability that y=1 is to specify&lt;BR /&gt;the response variable option EVENT='1'.&lt;BR /&gt;WARNING: There is a complete separation of data points. The maximum likelihood estimate does not exist.&lt;BR /&gt;WARNING: The LOGISTIC procedure continues in spite of the above warning. Results shown are based on the last maximum likelihood&lt;BR /&gt;iteration. Validity of the model fit is questionable.&lt;BR /&gt;NOTE: There were 10 observations read from the data set WORK.IMPORT1.&lt;BR /&gt;NOTE: PROCEDURE LOGISTIC used (Total process time):&lt;BR /&gt;real time 0.12 seconds&lt;BR /&gt;cpu time 0.12 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;71&lt;BR /&gt;72 proc logistic data = WORK.IMPORT1 desc;&lt;BR /&gt;73 model y = x1 x2;&lt;BR /&gt;74 exact x1 x2 /estimate=both;&lt;BR /&gt;75 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROC LOGISTIC is modeling the probability that y=1.&lt;BR /&gt;WARNING: There is a complete separation of data points. The maximum likelihood estimate does not exist.&lt;BR /&gt;WARNING: The LOGISTIC procedure continues in spite of the above warning. Results shown are based on the last maximum likelihood&lt;BR /&gt;iteration. Validity of the model fit is questionable.&lt;BR /&gt;NOTE: There were 10 observations read from the data set WORK.IMPORT1.&lt;BR /&gt;NOTE: PROCEDURE LOGISTIC used (Total process time):&lt;BR /&gt;real time 0.12 seconds&lt;BR /&gt;cpu time 0.12 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;76&lt;BR /&gt;77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;90&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 10:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349362#M18319</guid>
      <dc:creator>gretaolsson</dc:creator>
      <dc:date>2017-04-12T10:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exact logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349791#M18331</link>
      <description>&lt;P&gt;With only 10 observations in your posted dataset, split 2 and 8 between outcomes, I don't know that you'll be able to extract much from an analysis, but....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you plot the response against each predictor, it is clear that complete separation is due to X1. A solution can be obtained using Firth's penalized likelihood. See&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Allison: Convergence Failures in Logistic Regression" href="https://pdfs.semanticscholar.org/4f17/1322108dff719da6aa0d354d5f73c9c474de.pdf" target="_self"&gt;https://pdfs.semanticscholar.org/4f17/1322108dff719da6aa0d354d5f73c9c474de.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;A title="Understanding and correcting complete or quasi-complete separation problems" href="http://support.sas.com/kb/22/599.html" target="_self"&gt;http://support.sas.com/kb/22/599.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
    input a$ y x1 x2;
    datalines;
1. 1 1.489611900786800 -0.486983894512530
2. 1 0.887638190472230 -0.899961461187430
3. 1 -0.328400349680380 0.320480850960210
4. 0 -1.283346136073470 0.314729922388780
5. 1 -0.014384666024895 -1.040793737862780
6. 1 1.005337941612940 0.385444205622100
7. 1 0.403112850999760 0.797554772638080
8. 1 1.432508077938930 -0.553701810045310
9. 1 0.137341139238340 0.177313212434980
10. 0 -1.341507064615280 0.042985039337917
;
run;

proc sgplot data=have;
    scatter x=x1 y=y;
    run;

proc sgplot data=have;
    scatter x=x2 y=y;
    run;

proc logistic data = have desc;
 model y = x1 x2 / firth;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 16:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exact-logistic-regression/m-p/349791#M18331</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2017-04-13T16:16:14Z</dc:date>
    </item>
  </channel>
</rss>

