<?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 Expressing logistic and linear regression output into an equation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306456#M16229</link>
    <description>&lt;P&gt;I need to express my linear regression model as an equation so that I can calculate the predictions separately (ie, outside SAS). Ditto for my&amp;nbsp;logistic regression model. Could you confirm whether I'm doing this correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;LINEAR regression parameter estimates (using proc genmod)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: 3.9273&lt;/LI&gt;
&lt;LI&gt;var1: 0.0015&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I've expressed the equation as: &amp;nbsp; &amp;nbsp; prediction &amp;nbsp; = &amp;nbsp; 3.9273 + 0.0015*var1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;---------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;LOGISTIC regression parameter estimates (using proc logistic, binary, solving for "1")&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: -2.8240&lt;/LI&gt;
&lt;LI&gt;var2: 1.2638&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I've expressed the equation as: &amp;nbsp; &amp;nbsp;probability &amp;nbsp; = &amp;nbsp;&amp;nbsp;exp(-2.8240 + 1.2638*var2) &amp;nbsp; / &amp;nbsp; (1 + exp(-2.8240 + 1.2638*var2))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;---------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Yes, no, maybe so???&amp;nbsp;I need to confirm because when I do this, the answers do not match what I get when scoring&amp;nbsp;in SAS directly. Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2016 21:36:57 GMT</pubDate>
    <dc:creator>jawon</dc:creator>
    <dc:date>2016-10-21T21:36:57Z</dc:date>
    <item>
      <title>Expressing logistic and linear regression output into an equation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306456#M16229</link>
      <description>&lt;P&gt;I need to express my linear regression model as an equation so that I can calculate the predictions separately (ie, outside SAS). Ditto for my&amp;nbsp;logistic regression model. Could you confirm whether I'm doing this correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;LINEAR regression parameter estimates (using proc genmod)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: 3.9273&lt;/LI&gt;
&lt;LI&gt;var1: 0.0015&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I've expressed the equation as: &amp;nbsp; &amp;nbsp; prediction &amp;nbsp; = &amp;nbsp; 3.9273 + 0.0015*var1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;---------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;LOGISTIC regression parameter estimates (using proc logistic, binary, solving for "1")&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: -2.8240&lt;/LI&gt;
&lt;LI&gt;var2: 1.2638&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I've expressed the equation as: &amp;nbsp; &amp;nbsp;probability &amp;nbsp; = &amp;nbsp;&amp;nbsp;exp(-2.8240 + 1.2638*var2) &amp;nbsp; / &amp;nbsp; (1 + exp(-2.8240 + 1.2638*var2))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;---------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Yes, no, maybe so???&amp;nbsp;I need to confirm because when I do this, the answers do not match what I get when scoring&amp;nbsp;in SAS directly. Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 21:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306456#M16229</guid>
      <dc:creator>jawon</dc:creator>
      <dc:date>2016-10-21T21:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Expressing logistic and linear regression output into an equation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306462#M16230</link>
      <description>&lt;P&gt;Here's a good thread on this topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/How-to-determine-logistic-regression-formula-from-estimates/m-p/120780/highlight/true#M6321" target="_blank"&gt;https://communities.sas.com/t5/SAS-Statistical-Procedures/How-to-determine-logistic-regression-formula-from-estimates/m-p/120780/highlight/true#M6321&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It has a worked example, the Neuralgia dataset is in SAS documentation if you want to test the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, look at the CODE statement in those procs if you're in SAS/STAT 13+&lt;/P&gt;
&lt;P&gt;This will generate sas data step code that will score your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can use PROC SCORE or the SCORE statement within those procs.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 21:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306462#M16230</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T21:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Expressing logistic and linear regression output into an equation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306785#M16236</link>
      <description>&lt;P&gt;See &lt;A href="http://support.sas.com/kb/51544" target="_self"&gt;this note&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/306785#M16236</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2016-10-24T14:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Expressing logistic and linear regression output into an equation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/307791#M16285</link>
      <description>&lt;P&gt;Not finding the answer yet. Sorry for being a numbskull. I'll try to be more specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PART 1: My linear regression code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;proc genmod data = mydataset;
model amount = var1 / &lt;BR /&gt;link = log  
dist = gamma 
type3;
output &lt;BR /&gt;out = myoutput
p = pred;
run;&lt;/PRE&gt;
&lt;P&gt;The resulting parameter estimates:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: 3.9273&lt;/LI&gt;
&lt;LI&gt;var1: 0.0015&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This is a gamma distribution with a log link, so I guess that complicates matters. How should I translate this into an actual mathematical equation?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PART 2: My logistic regression code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;proc logistic data = my_training_dataset
outmodel = my_model_info;
model responded (event = '1') = var2 /&lt;BR /&gt;selection = stepwise 
lackfit 
rsq;
run;

proc logistic inmodel = my_model_info;
score data = my_dataset_to_score
out  = my_scored_dataset;
run;&lt;/PRE&gt;
&lt;P&gt;The resulting parameter estimates:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Intercept: -2.8240&lt;/LI&gt;
&lt;LI&gt;var2: 1.2638&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;How should I translate this into an actual mathematical equation?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 00:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/307791#M16285</guid>
      <dc:creator>jawon</dc:creator>
      <dc:date>2016-10-28T00:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Expressing logistic and linear regression output into an equation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/307794#M16286</link>
      <description>&lt;P&gt;Use the CODE statement in either proc and examine the output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The initial thread I linked too walked through the solution for LOGISTIC regression in detail so I'm not sure what I could add besides replicating it specifically for your exact values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 00:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Expressing-logistic-and-linear-regression-output-into-an/m-p/307794#M16286</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-28T00:49:12Z</dc:date>
    </item>
  </channel>
</rss>

