<?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: proc score with no intercept in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326371#M17232</link>
    <description>&lt;P&gt;Dear Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's hard to explain, but I have to fit the model with intercept&amp;nbsp;using&amp;nbsp;the original data, then score the fitted model with another dataset without intercept.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'm trying to use PROC SCORE as you suggestted in my another post to realize it, here is the code I'm using:&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;logistic&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;FONT color="#0000ff" face="Courier New" size="2"&gt;descending&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;outest&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modelname ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;model&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; outcome= &amp;amp;continue_vars &amp;amp;class_vars; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modeldata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;PREDICTED&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=prob;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&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;score&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;=dataname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;score&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modelname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=dataname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;type&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=parms;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;selected_variables;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the second part PROC SCORE, i want to remove the intercept.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2017 18:12:07 GMT</pubDate>
    <dc:creator>Xiaoningdemao</dc:creator>
    <dc:date>2017-01-20T18:12:07Z</dc:date>
    <item>
      <title>proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326166#M17219</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about proc score. i want to score a new dataset, but leaving the intercept out. how to do that?&lt;/P&gt;&lt;P&gt;i.e., for observations in new datasets, i wnat to calculate:&lt;/P&gt;&lt;P&gt;beta1*x1+beta2*x2+ ... + beta_p*x_p&lt;/P&gt;&lt;P&gt;instead of:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;intecept&lt;/STRONG&gt; + beta1*x1+beta2*x2+ ... + beta_p*x_p&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to do this for many models, so mannully subtract the intercept from the result is not very ideal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best wishes.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 02:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326166#M17219</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T02:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326170#M17220</link>
      <description>&lt;P&gt;Why fit a model with intercept in the first place?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 03:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326170#M17220</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T03:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326171#M17221</link>
      <description>&lt;P&gt;You haven't posted any code so it's hard to say, different procs have different options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post what you're currently doing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 03:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326171#M17221</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T03:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326371#M17232</link>
      <description>&lt;P&gt;Dear Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's hard to explain, but I have to fit the model with intercept&amp;nbsp;using&amp;nbsp;the original data, then score the fitted model with another dataset without intercept.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'm trying to use PROC SCORE as you suggestted in my another post to realize it, here is the code I'm using:&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;logistic&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;FONT color="#0000ff" face="Courier New" size="2"&gt;descending&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;outest&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modelname ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;model&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; outcome= &amp;amp;continue_vars &amp;amp;class_vars; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modeldata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;PREDICTED&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=prob;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&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;score&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;=dataname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;score&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=modelname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=dataname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;type&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=parms;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;selected_variables;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the second part PROC SCORE, i want to remove the intercept.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326371#M17232</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T18:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326375#M17233</link>
      <description>&lt;P&gt;Examine the dataset called MODELNAME.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326375#M17233</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T18:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326380#M17234</link>
      <description>&lt;P&gt;Post-fitting analyses such as scoring use a model that is computed and stored by a regression procedure. &amp;nbsp;You can't expect to score a model that you have not fit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fit a regression model without an intercept, use the NOINT&amp;nbsp;option on the model statement, like this&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;amp;class_vars;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;model&lt;/FONT&gt; outcome= &amp;amp;continue_vars &amp;amp;class_vars / NOINT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;If, for some strange reason, you ABSOLUTELY need to do what&amp;nbsp;you are asking, you can use a DATA step view to recenter the response variable in the scoring data. That is, if you have fit the model&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Y = Int + b1*x1 + b2*x2 + ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;and you define a new variable&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;YNew = Y +&amp;nbsp;Int&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;then PROC SCORE (or PROC PLM) will score the data for&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;YNew =&amp;nbsp;&lt;SPAN&gt;Int + b1*x1 + b2*x2 + ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;which is of course equivalent to&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Y =&amp;nbsp;&lt;SPAN&gt;b1*x1 + b2*x2 + ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326380#M17234</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-01-20T18:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326392#M17238</link>
      <description>Dear Rick,&lt;BR /&gt;&lt;BR /&gt;So you are saying that I cannot force PROC SCORE to omit any variable that is in the original model, right?&lt;BR /&gt;Yeah, I know it's weird, but I really need to do what I asked......&lt;BR /&gt;So basically I need to subtract the intercept manually, right?&lt;BR /&gt;&lt;BR /&gt;Then my question is, how to put a value from a dataset into macro variable? I want to put the intercept into a marco variable, so I can subtract it from the PROC SCORE's result, and don't need to manually type in the numbers.&lt;BR /&gt;&lt;BR /&gt;Thank you!!!&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326392#M17238</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T18:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326393#M17239</link>
      <description>never mind, I got it..&lt;BR /&gt;Thank you!!</description>
      <pubDate>Fri, 20 Jan 2017 19:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326393#M17239</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T19:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326394#M17240</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;gt; So you are saying that I cannot force PROC SCORE to omit any variable that is in the original model, right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I did not say that. For linear models, if you set the data for a variable to zero, then that is equivalent to having a zero estimate, which omits that term.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Yeah, I know it's weird, but I really need to do what I asked......&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;So you say, but most analysts agree that "if you can't explain it then you shouldn't do it."&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; So basically I need to subtract the intercept manually, right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I recommend that you use the NOINT&amp;nbsp;option in the model statement. My explanation was for a linear model. The example you give is a logistic model, which has a binary response and a (logit) link function. The link function makes the math more complicated.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Then my question is, how to put a value from a dataset into macro variable?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You won't need it if you use NOINT. But the answer is to read &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n1nexcs36ctqk5n11uao7k9myz7y.htm" target="_self"&gt;the doc for the SYMPUTX subroutine&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 19:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326394#M17240</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-01-20T19:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326396#M17241</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; So you are saying that I cannot force PROC SCORE to omit any variable that is in the original model, right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;I did not say that. For linear models, if you set the data for a variable to zero, then that is equivalent to having a zero estimate, which omits that term.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh, is that means I have to modify the dataset to be scored, and cannot achive it by adding commands to the PROC SCORE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I recommend that you use the NOINT&amp;nbsp;option in the model statement.&lt;/P&gt;&lt;P&gt;you mean add NOINT in proc logist or in proc score? is there a model statement in proc score?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;So you say, but most analysts agree that "if you can't explain it then you shouldn't do it."&lt;/P&gt;&lt;P&gt;To make it short, the reason why i do so is to adjust the baseline(intercept) for the new dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you again!!&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 20:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326396#M17241</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T20:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326403#M17244</link>
      <description>&lt;P&gt;I don't think a straight subtraction works for a logistic regression model, it would for linear regression though. You have to be careful with how/when you do the conversion to probability.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 20:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326403#M17244</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T20:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326421#M17245</link>
      <description>&lt;P&gt;Here's an example of how to 'remove' the intercept from a scored dataset for logistic regression. Note that to score logistic regression you should use the SCORE within PROC LOGISTIC. You can also use the CODE statement to generate your scoring program and then manually remove/reverse the prediction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the predicted probability is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P = 1/(1-exp (-1* (intercept + B1*X1 + B2*X2 .. + BN*XN)));&lt;/P&gt;
&lt;P&gt;P = 1/(1-exp(-1*X)));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You first need to recalculate the X, then remove the intercept and then re-apply the function.&amp;nbsp;&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;PRE&gt;&lt;CODE class=" language-sas"&gt;*Generate a model to test;&lt;BR /&gt;proc logistic data=sashelp.heart outest=estimates;
model status = ageatStart height weight;
output out=withIntercept p=pred;
code file='c:\_localdata\score_ex.sas';
run;
&lt;BR /&gt;*create macro variable with intercept;
proc sql noprint;
select intercept into :intercept
from estimates;
quit;
&lt;BR /&gt;*Remove the intercept and calculate the probability with out the intercept;
data modify;
set withIntercept;

rescaled = -1*log((pred**-1) -1);

pred_no_intercept = 1/(1+exp(-1*(rescaled - &amp;amp;intercept)));

diff = pred-pred_no_intercept;

run;
&lt;BR /&gt;*Display the results.
proc print data=modify (obs=20);
var pred  rescaled  pred_no_intercept diff  ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the results from the CODE statement, note that I manually changed the intercept here to 0. You could probably do this via a program but it seems like too much work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*****************************************;
** SAS Scoring Code for PROC Logistic;
*****************************************;
data woIntercept_check;
set sashelp.heart;

length I_Status $ 5;
label I_Status = 'Into: Status' ;
length U_Status $ 5;
label U_Status = 'Unnormalized Into: Status' ;
label P_StatusAlive = 'Predicted: Status=Alive' ;
label P_StatusDead = 'Predicted: Status=Dead' ;

drop _LMR_BAD;
_LMR_BAD=0;

*** Check interval variables for missing values;
if nmiss(AgeAtStart,Height,Weight) then do;
   _LMR_BAD=1;
   goto _SKIP_000;
end;

*** Compute Linear Predictors;
drop _LP0;
_LP0 = 0;

*** Effect: AgeAtStart;
_LP0 = _LP0 + (-0.1204973720723) * AgeAtStart;
*** Effect: Height;
_LP0 = _LP0 + (-0.04255625097121) * Height;
*** Effect: Weight;
_LP0 = _LP0 + (-0.00633992910933) * Weight;

*** Predicted values;
drop _MAXP _IY _P0 _P1;


******************************************************************************;
Change intercept here to 0 from calculated value;
*_TEMP = 9.63617021104433  + _LP0;

*New Code;
_TEMP = 0  + _LP0;

******************************************************************************;



if (_TEMP &amp;lt; 0) then do;
   _TEMP = exp(_TEMP);
   _P0 = _TEMP / (1 + _TEMP);
end;
else _P0 = 1 / (1 + exp(-_TEMP));
_P1 = 1.0 - _P0;
P_StatusAlive = _P0;
_MAXP = _P0;
_IY = 1;
P_StatusDead = _P1;
if (_P1 &amp;gt;  _MAXP + 1E-8) then do;
   _MAXP = _P1;
   _IY = 2;
end;
select( _IY );
   when (1) do;
      I_Status = 'Alive' ;
      U_Status = 'Alive' ;
   end;
   when (2) do;
      I_Status = 'Dead' ;
      U_Status = 'Dead ' ;
   end;
   otherwise do;
      I_Status = '';
      U_Status = '';
   end;
end;
_SKIP_000:
if _LMR_BAD = 1 then do;
I_Status = '';
U_Status = '';
P_StatusAlive = .;
P_StatusDead = .;
end;
drop _TEMP;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this case there's a significant difference when you remove the intercept.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 21:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326421#M17245</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T21:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326435#M17248</link>
      <description>Dear Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you for the code!!!&lt;BR /&gt;I need to remove the intercept in the scoring dataset not in the model building dataset. So I think it's fine.&lt;BR /&gt;&lt;BR /&gt;I wrote a similar code as yours to subtract the intercept from the result in PROC SCORE and calculated the predicted prob.&lt;BR /&gt;&lt;BR /&gt;Thanks very much for your help!&lt;BR /&gt;&lt;BR /&gt;Best wishes.</description>
      <pubDate>Fri, 20 Jan 2017 22:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326435#M17248</guid>
      <dc:creator>Xiaoningdemao</dc:creator>
      <dc:date>2017-01-20T22:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc score with no intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326442#M17249</link>
      <description>&lt;P&gt;A quick check is to make sure your probabilities/results are between 0 and 1. If not, its not correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: FYI- &amp;nbsp;This did remove it in the scored dataset, I just used the same dataset to score/model because I didn't want to make up more data.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 22:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-score-with-no-intercept/m-p/326442#M17249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T22:46:17Z</dc:date>
    </item>
  </channel>
</rss>

