<?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: apply a new data set to a logistic regression model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290348#M15427</link>
    <description>&lt;P&gt;I don't know the answer...I've moved the question to the Stats Forum and hopefully one of the stats guru can answer your question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;? &amp;nbsp;&lt;img id="cathappy" class="emoticon emoticon-cathappy" src="https://communities.sas.com/i/smilies/16x16_cat-happy.png" alt="Cat Happy" title="Cat Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 22:48:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-08-08T22:48:11Z</dc:date>
    <item>
      <title>apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/289676#M15423</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set named as 'modeldata'. I first use bootstrap to ge a bootstrap sample named 'out'. I fit the logistic model with the bootstrap sample 'out'. Now i want to evaluate the performance of the bootstrap sample model by apply the original data 'modeldat' to it, and check for the c-statistic or c-index. Is there a way to do so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached my code below, hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;multtest&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modeldata&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nsample&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;OUTSAMP&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=OUT &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SEED&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nocenter&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;BOOTSTRAP&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;test&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;mean&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;(pass age height); &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;logistic&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=out &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;descending&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=logisticest; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;model&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; pass=age height;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 22:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/289676#M15423</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2016-08-04T22:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/289686#M15425</link>
      <description>&lt;P&gt;It's called Scoring a model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at SCORE within PROC LOGISTIC, I believe there's an example in the documentation, or look at PROC PLM.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 00:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/289686#M15425</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-05T00:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290347#M15426</link>
      <description>&lt;P&gt;Dear Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!! Following what you suggested, I find this at support. sas: &lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_sect066.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_sect066.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I think by using outmodle and then inmodel, I&amp;nbsp; can use the old model to fit the new data. But, the 'fitstat' option doesn't gave me the c-statistic I&amp;nbsp;need.&lt;/P&gt;&lt;P&gt;Do I have to calculate it manunaly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did before is, store the estimated coefficients of the model estimated by old sampe, assign it as the initial value of the new data, and set convergence criterion to huge number. By doing this will i get what i want? Cause this way i can get the c-statistic. I attached the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best wishes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods output Association=C_boot;&lt;/P&gt;&lt;P&gt;proc logistic data=boot descending out=boot_est;&lt;/P&gt;&lt;P&gt;model pass=age gender height;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=C_boot (keep=nValue2) out=C_boot(keep=col4);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods output Association=C_test;&lt;/P&gt;&lt;P&gt;proc logistic data=newdata descending INEST=boot_est;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;model pass=age gender height/GCONV=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;100000&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 22:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290347#M15426</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2016-08-08T22:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290348#M15427</link>
      <description>&lt;P&gt;I don't know the answer...I've moved the question to the Stats Forum and hopefully one of the stats guru can answer your question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;? &amp;nbsp;&lt;img id="cathappy" class="emoticon emoticon-cathappy" src="https://communities.sas.com/i/smilies/16x16_cat-happy.png" alt="Cat Happy" title="Cat Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 22:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290348#M15427</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-08T22:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290350#M15428</link>
      <description>Dear Reeza,&lt;BR /&gt;Thanks a lot!!&lt;BR /&gt;Best wishes.&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290350#M15428</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2016-08-08T23:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290433#M15434</link>
      <description>&lt;P&gt;In the&amp;nbsp;first call to PROC LOGISTIC you fit the model. In the second call you need to use the SCORE statement to evaluate the model on a new set of data. The FITSTAT option displays fit statistics for the model evaluated on the new data. The AUC column gives the area under the ROC curve, which is equal to the 'c' statistic in the association table. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics off;
proc logistic data=sashelp.class descending OUTmodel=LogiModel;
model sex = age weight height;
run;
 
data newdata;
set sashelp.class;
where 14 &amp;lt;= age &amp;lt;= 16;
run;

proc logistic descending INmodel=logiModel;
score data = newdata fitstat;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 12:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290433#M15434</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-08-09T12:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: apply a new data set to a logistic regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290775#M15459</link>
      <description>Dear Rick,&lt;BR /&gt;Perfect!&lt;BR /&gt;Thank you very much~&lt;BR /&gt;PS: I read a few of your blogs on other topics lately. I found them very helpful~~&lt;BR /&gt;&lt;BR /&gt;Best wishes.</description>
      <pubDate>Wed, 10 Aug 2016 17:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/apply-a-new-data-set-to-a-logistic-regression-model/m-p/290775#M15459</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2016-08-10T17:25:34Z</dc:date>
    </item>
  </channel>
</rss>

