<?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: Not sure why this code will not run in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962172#M43196</link>
    <description>&lt;P&gt;figured it out - simple miscoding of the data call :/.&amp;nbsp; It works now - it was definitely switching the Y and the 47.1.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 04:17:23 GMT</pubDate>
    <dc:creator>BoboTheFoolish</dc:creator>
    <dc:date>2025-03-19T04:17:23Z</dc:date>
    <item>
      <title>Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962159#M43190</link>
      <description>&lt;P&gt;I am trying to get starting values for a non-linear regression problem.&amp;nbsp; When I run my code it gives me an error with the log portion of the code in the proc reg, but I need to run it to get my starting values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA MUSSELS;&lt;BR /&gt;INPUT Y X;&lt;BR /&gt;X = X;&lt;BR /&gt;YI = -LOG(Y - 47.1);&lt;BR /&gt;CARDS;&lt;BR /&gt;29.2&amp;nbsp; 4&lt;BR /&gt;28.6&amp;nbsp; 4&lt;BR /&gt;29.4&amp;nbsp; 5&lt;BR /&gt;33.0&amp;nbsp; 5&lt;BR /&gt;28.2&amp;nbsp; 6&lt;BR /&gt;33.9&amp;nbsp; 6&lt;BR /&gt;33.1&amp;nbsp; &amp;nbsp;6&lt;BR /&gt;33.2&amp;nbsp; 7&lt;BR /&gt;31.4&amp;nbsp; 7&lt;BR /&gt;37.8&amp;nbsp; 7&lt;BR /&gt;36.9&amp;nbsp; 8&lt;BR /&gt;40.2&amp;nbsp; 8&lt;BR /&gt;39.2 9&lt;BR /&gt;40.6 9&lt;BR /&gt;35.2 10&lt;BR /&gt;43.3 10&lt;BR /&gt;42.3 13&lt;BR /&gt;41.4&amp;nbsp; 13&lt;BR /&gt;45.2 14&lt;BR /&gt;47.1&amp;nbsp; 18&lt;BR /&gt;;&lt;BR /&gt;PROC REG;&lt;BR /&gt;MODEL YI = X;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 02:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962159#M43190</guid>
      <dc:creator>BoboTheFoolish</dc:creator>
      <dc:date>2025-03-19T02:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962164#M43192</link>
      <description>What do you mean by "get my starting values."?&lt;BR /&gt;You ought to know  in LOG(x)  , x should be greated than 0, but your "Y - 47.1" will always got negative value.&lt;BR /&gt;Maybe you want this :  YI = LOG(47.1-Y)  ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DATA MUSSELS;&lt;BR /&gt;INPUT Y X;&lt;BR /&gt;YI = LOG(47.1-Y);&lt;BR /&gt;CARDS;&lt;BR /&gt;29.2  4&lt;BR /&gt;28.6  4&lt;BR /&gt;29.4  5&lt;BR /&gt;33.0  5&lt;BR /&gt;28.2  6&lt;BR /&gt;33.9  6&lt;BR /&gt;33.1   6&lt;BR /&gt;33.2  7&lt;BR /&gt;31.4  7&lt;BR /&gt;37.8  7&lt;BR /&gt;36.9  8&lt;BR /&gt;40.2  8&lt;BR /&gt;39.2 9&lt;BR /&gt;40.6 9&lt;BR /&gt;35.2 10&lt;BR /&gt;43.3 10&lt;BR /&gt;42.3 13&lt;BR /&gt;41.4  13&lt;BR /&gt;45.2 14&lt;BR /&gt;47.0  18&lt;BR /&gt;;&lt;BR /&gt;proc sgplot data=MUSSELS;&lt;BR /&gt;reg y=yi x=x/degree=2;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 19 Mar 2025 03:32:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962164#M43192</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-19T03:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962167#M43194</link>
      <description>&lt;P&gt;So, I am doing the Gauss Newton procedure for Non-Linear regression, and this initial code is used to find starting values for the parameters so I can run the non-linear regression on the equation.&amp;nbsp; So the equation is Y = Alpha - EXP[-(Beta + gamma*X)].&amp;nbsp; You have to find a starting value for alpha from the data by figuring out how to linearize the equation.&amp;nbsp; You can't linearize it, so knowing as X gets large the equation becomes Y = alpha, you pick the largest Y value to throw in for alpha, and then when you take the linearized part of Y with that parameter and run proc reg on it, it should give an intercept and beta value for X that give you starting values for the other parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code for the in-class example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA MINING;&lt;BR /&gt;INPUT W D Y;&lt;BR /&gt;X = W/D;&lt;BR /&gt;YB = LOG(1 - Y/35);&lt;BR /&gt;CARDS;&lt;BR /&gt;610 550 33.6&lt;BR /&gt;450 500 22.3&lt;BR /&gt;450 520 22.0&lt;BR /&gt;430 740 18.7&lt;BR /&gt;410 800 20.2&lt;BR /&gt;500 230 31.0&lt;BR /&gt;500 235 30.0&lt;BR /&gt;500 240 32.0&lt;BR /&gt;450 600 26.6&lt;BR /&gt;450 650 15.1&lt;BR /&gt;480 230 30.0&lt;BR /&gt;475 1400 13.5&lt;BR /&gt;485 615 26.8&lt;BR /&gt;474 515 25.0&lt;BR /&gt;485 700 20.4&lt;BR /&gt;600 750 15.0&lt;BR /&gt;;&lt;BR /&gt;PROC REG;&lt;BR /&gt;MODEL YB = X;&lt;BR /&gt;PROC NLIN DATA = MINING METHOD = GAUSS;&lt;BR /&gt;MODEL Y = A*(1-EXP((-1)*B*X));&lt;BR /&gt;PARMS A = 35 B = .8672;&lt;BR /&gt;OUTPUT OUT=TWO P=PRED R=RESID;&lt;/P&gt;&lt;P&gt;PROC PRINT;&lt;BR /&gt;VAR Y PRED RESID;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the prof ran the original proc reg to get the B parameter before coding the rest&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 03:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962167#M43194</guid>
      <dc:creator>BoboTheFoolish</dc:creator>
      <dc:date>2025-03-19T03:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962171#M43195</link>
      <description>&lt;P&gt;So I didn't solve the equation correctly, and it should have been alpha - Y..... (47.1 - Y), and that gave me values, however the code dropped an observation, and I'm not sure why&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA MUSSELS;&lt;BR /&gt;INPUT Y X;&lt;/P&gt;&lt;P&gt;YB = -LOG(47.1 - Y);&lt;BR /&gt;CARDS;&lt;BR /&gt;29.2 4&lt;BR /&gt;28.6 4&lt;BR /&gt;29.4 5&lt;BR /&gt;33.0 5&lt;BR /&gt;28.2 6&lt;BR /&gt;33.9 6&lt;BR /&gt;33.1 6&lt;BR /&gt;33.2 7&lt;BR /&gt;31.4 7&lt;BR /&gt;37.8 7&lt;BR /&gt;36.9 8&lt;BR /&gt;40.2 8&lt;BR /&gt;39.2 9&lt;BR /&gt;40.6 9&lt;BR /&gt;35.2 10&lt;BR /&gt;43.3 10&lt;BR /&gt;42.3 13&lt;BR /&gt;41.4 13&lt;BR /&gt;45.2 14&lt;BR /&gt;47.1 18&lt;BR /&gt;;&lt;BR /&gt;PROC REG;&lt;BR /&gt;MODEL YB = X;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC NLIN DATA = MINING METHOD = MARQUARDT NOHALVE;&lt;BR /&gt;MODEL Y = A - EXP((-1)*(B + C*X));&lt;BR /&gt;PARMS A = 47.1&amp;nbsp; B = -3.72144&amp;nbsp; C = 0.18315;&lt;BR /&gt;OUTPUT OUT=TWO P=PRED R=RESID;&lt;/P&gt;&lt;P&gt;PROC PRINT;&lt;BR /&gt;VAR Y PRED RESID;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 04:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962171#M43195</guid>
      <dc:creator>BoboTheFoolish</dc:creator>
      <dc:date>2025-03-19T04:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962172#M43196</link>
      <description>&lt;P&gt;figured it out - simple miscoding of the data call :/.&amp;nbsp; It works now - it was definitely switching the Y and the 47.1.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 04:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962172#M43196</guid>
      <dc:creator>BoboTheFoolish</dc:creator>
      <dc:date>2025-03-19T04:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure why this code will not run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962181#M43197</link>
      <description>&lt;P&gt;That is because you have 47.1 at the last record.&lt;/P&gt;
&lt;PRE&gt;DATA MUSSELS;
INPUT Y X;

YB = -LOG(47.1 - Y);
CARDS;
29.2 4
28.6 4
29.4 5
33.0 5
28.2 6
33.9 6
33.1 6
33.2 7
31.4 7
37.8 7
36.9 8
40.2 8
39.2 9
40.6 9
35.2 10
43.3 10
42.3 13
41.4 13
45.2 14
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;47.1&lt;/STRONG&gt;&lt;/FONT&gt; 18
;&lt;/PRE&gt;
&lt;P&gt;LOG(47.1-47.1) ==&amp;gt; LOG(0) ,that is not right, it should be greater than zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to change it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 06:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-sure-why-this-code-will-not-run/m-p/962181#M43197</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-19T06:23:55Z</dc:date>
    </item>
  </channel>
</rss>

