<?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: Generate Equation based on Estimates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215580#M39779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;CATX&lt;/STRONG&gt; function concatenates values (strings or formatted numbers) and adds the first function argument (e.g. &lt;STRONG&gt;" + "&lt;/STRONG&gt;) between the concatenated values. So here, the string &lt;STRONG&gt;eq&lt;/STRONG&gt; is built up by adding to it ( &lt;STRONG&gt;eq = catx(" + ", eq, &lt;EM&gt;something&lt;/EM&gt;)&lt;/STRONG&gt; ) the intercept estimate or the concatenation of the estimate and the variable name, separated by &lt;STRONG&gt;" * "&lt;/STRONG&gt;, using the &lt;STRONG&gt;CATX&lt;/STRONG&gt; function again. Initially, &lt;STRONG&gt;eq&lt;/STRONG&gt; is empty.&lt;/P&gt;&lt;P&gt;Read the manual for more fun details about the CATX, CATS, and CATT functions &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2015 21:40:34 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-08-04T21:40:34Z</dc:date>
    <item>
      <title>Generate Equation based on Estimates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215577#M39776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to generate logistic regression equation based on coefficient estimates. I am trying to find automate solution -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The coefficient estimates are stored in a dataset. They look like below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="126"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="65"&gt;Variables&lt;/TD&gt;&lt;TD width="61"&gt;Estimate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Intercept&lt;/TD&gt;&lt;TD align="right"&gt;0.001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ABCD&lt;/TD&gt;&lt;TD align="right"&gt;0.558356&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;DEFG&lt;/TD&gt;&lt;TD align="right"&gt;0.464783&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;HIJKL&lt;/TD&gt;&lt;TD align="right"&gt;0.111268&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;MNOP&lt;/TD&gt;&lt;TD align="right"&gt;0.811915&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;score = 0.001 + 0.558356 * ABCD + 0.464783 * DEFG + 0.111269 * HIJKL + 0.811915 * MNOP&lt;/P&gt;&lt;P&gt;p = 1 / (1 + exp(-score))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the following equation to be stored in a separate data set. In this data set, there would be a single column named "Equation" and first row contains the equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P_1 = 1 / (1 + exp( -(0.001 + 0.558356 * ABCD + 0.464783 * DEFG + 0.111269 * HIJKL + 0.811915 * MNOP))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I am aware of SCORE, OUTMODEL and INMODEL statements in PROC LOGISTIC to calculate predicted probability. But my task is to note down the equation based on estimates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Aug 2015 17:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215577#M39776</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-08-02T17:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Equation based on Estimates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215578#M39777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Build the string using CAT_ functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;length eq $200;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do until (done);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set estimates end=done;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Variable = "Intercept" then &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq = catx(" + ", Eq, Estimate);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq = catx(" + ", Eq, catx(" * ", Estimate, Variable));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Eq = cats( "P_1 = 1 / (1 + exp( -(", Eq, "))");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep Eq;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Aug 2015 18:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215578#M39777</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-08-02T18:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Equation based on Estimates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215579#M39778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton. It works like charm. Could you please explain how it works - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; if Variable = "Intercept" then&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq = catx(" + ", Eq, Estimate);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq = catx(" + ", Eq, catx(" * ", Estimate, Variable));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 20:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215579#M39778</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-08-04T20:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Equation based on Estimates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215580#M39779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;CATX&lt;/STRONG&gt; function concatenates values (strings or formatted numbers) and adds the first function argument (e.g. &lt;STRONG&gt;" + "&lt;/STRONG&gt;) between the concatenated values. So here, the string &lt;STRONG&gt;eq&lt;/STRONG&gt; is built up by adding to it ( &lt;STRONG&gt;eq = catx(" + ", eq, &lt;EM&gt;something&lt;/EM&gt;)&lt;/STRONG&gt; ) the intercept estimate or the concatenation of the estimate and the variable name, separated by &lt;STRONG&gt;" * "&lt;/STRONG&gt;, using the &lt;STRONG&gt;CATX&lt;/STRONG&gt; function again. Initially, &lt;STRONG&gt;eq&lt;/STRONG&gt; is empty.&lt;/P&gt;&lt;P&gt;Read the manual for more fun details about the CATX, CATS, and CATT functions &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 21:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Equation-based-on-Estimates/m-p/215580#M39779</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-08-04T21:40:34Z</dc:date>
    </item>
  </channel>
</rss>

