<?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 ROC curve for hold out sample in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/ROC-curve-for-hold-out-sample/m-p/357411#M18794</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to make a ROC curve for an hold out sample. The thing is, i made a logistic regression for some data i have from the year 2007 and I want to see how this model fits the data in the year 2008. I can't use this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc logistic data = sasdata.Data2008;&lt;BR /&gt;model flag(event='1')=TL_TA EAT_TA AGE /outroc=r;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because then my model and my ROC curve is based on a logistic regression on the 2008 dataset. I want to do a logistc regression on the 2007 set, and then use this fit to see how it fits the 2008 data set. So i tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=sasdata.data2007;&lt;BR /&gt;class AGE (ref='Ny') / param = ref;&lt;BR /&gt;model flag(event="1") = TL_TA EAT_TA AGE / CTABLE outroc=troc;&lt;BR /&gt;score data=sasdata.data2008 out=valpred outroc=vroc;&lt;BR /&gt;roc; roccontrast;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems ok. I get a ROC curve both for the fit of 2007 and then a ROC curve for how the 2007 model fits on the 2008 model. The thing is, i want to find the optimale cutoff point in 2008, where the euclidean distance from 1.0 is minimized to the ROC curve, how can i do that? The ctable option gives me the predicted probabilities for the 2007 data set only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help.&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 10:25:56 GMT</pubDate>
    <dc:creator>yocrachi</dc:creator>
    <dc:date>2017-05-10T10:25:56Z</dc:date>
    <item>
      <title>ROC curve for hold out sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ROC-curve-for-hold-out-sample/m-p/357411#M18794</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to make a ROC curve for an hold out sample. The thing is, i made a logistic regression for some data i have from the year 2007 and I want to see how this model fits the data in the year 2008. I can't use this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc logistic data = sasdata.Data2008;&lt;BR /&gt;model flag(event='1')=TL_TA EAT_TA AGE /outroc=r;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because then my model and my ROC curve is based on a logistic regression on the 2008 dataset. I want to do a logistc regression on the 2007 set, and then use this fit to see how it fits the 2008 data set. So i tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=sasdata.data2007;&lt;BR /&gt;class AGE (ref='Ny') / param = ref;&lt;BR /&gt;model flag(event="1") = TL_TA EAT_TA AGE / CTABLE outroc=troc;&lt;BR /&gt;score data=sasdata.data2008 out=valpred outroc=vroc;&lt;BR /&gt;roc; roccontrast;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems ok. I get a ROC curve both for the fit of 2007 and then a ROC curve for how the 2007 model fits on the 2008 model. The thing is, i want to find the optimale cutoff point in 2008, where the euclidean distance from 1.0 is minimized to the ROC curve, how can i do that? The ctable option gives me the predicted probabilities for the 2007 data set only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 10:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ROC-curve-for-hold-out-sample/m-p/357411#M18794</guid>
      <dc:creator>yocrachi</dc:creator>
      <dc:date>2017-05-10T10:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: ROC curve for hold out sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ROC-curve-for-hold-out-sample/m-p/357912#M18799</link>
      <description>&lt;P&gt;See the &lt;A href="http://support.sas.com/kb/25018" target="_self"&gt;ROCPLOT macro&lt;/A&gt;. Specify&amp;nbsp;the SCORE OUTROC= data set in&amp;nbsp;the INROC= macro option, and the SCORE OUT= data set and its predicted probabilities in the macro's INPRED= and P= options. &amp;nbsp;See the macro documentation for information on the various optimality criteria you can use.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 14:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ROC-curve-for-hold-out-sample/m-p/357912#M18799</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2017-05-11T14:22:05Z</dc:date>
    </item>
  </channel>
</rss>

