<?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: Polynomial regression: export estimated value and error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828605#M327320</link>
    <description>&lt;P&gt;Example: &lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_reg_gettingstarted02.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/statug/15.2/statug_reg_gettingstarted02.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Aug 2022 11:14:16 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-08-14T11:14:16Z</dc:date>
    <item>
      <title>Polynomial regression: export estimated value and error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828596#M327312</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have a timeseries and would like to run a polynomial regression of value on time and save the estimated value and error to a new file.&lt;/P&gt;
&lt;P&gt;Can you please help?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*THIS ONE WORK*/
proc datasets lib=work kill noprint;run;DM "log; clear; ";ods html close;ods html;

data test;
infile datalines missover;
input month Orders;
yearMonth = mod(month,12);
actual= not missing(orders);
datalines;

1 26156
2 32396
3 27415
4 24129
5 30350
6 21992
7 24705
8 36434
9 28858
10 37353
11 43137
12 52119
13 42119
14 42119
15 62119
16 72119
17 42119
18 62119
;

proc sgplot data=test;
reg x =month  y=orders /degree=10 clm;
title 'sgplot';

run;


proc glm data=test;
model orders = 
month 
month*month  
month*month*month  
month*month*month*month 
month*month*month*month*month
month*month*month*month*month*month
month*month*month*month*month*month*month
month*month*month*month*month*month*month*month
month*month*month*month*month*month*month*month*month
month*month*month*month*month*month*month*month*month*month
/ PREDICTED E;
output out=glm p=pred r=residual;
;
title 'GML regression';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Aug 2022 15:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828596#M327312</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2022-08-14T15:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Polynomial regression: export estimated value and error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828605#M327320</link>
      <description>&lt;P&gt;Example: &lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_reg_gettingstarted02.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/statug/15.2/statug_reg_gettingstarted02.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2022 11:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828605#M327320</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-14T11:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Polynomial regression: export estimated value and error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828613#M327328</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2022 15:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828613#M327328</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2022-08-14T15:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Polynomial regression: export estimated value and error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828625#M327333</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt; says&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;/*THIS ONE WORK*/
proc glm data=test;
model orders = 
month 
month*month  
month*month*month  
month*month*month*month 
month*month*month*month*month
month*month*month*month*month*month
month*month*month*month*month*month*month
month*month*month*month*month*month*month*month
month*month*month*month*month*month*month*month*month
month*month*month*month*month*month*month*month*month*month
/ PREDICTED E;&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may work, meaning that the code doesn't have errors and produced output, but a 10th order polynomial fit to this data (or any other data that I know of) is completely inappropriate in the real world. You have most likely fit the noise of the data rather than finding a real signal, meaning that you have not really found a useful answer (you have found code that doesn't cause errors, that's all).&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2022 20:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828625#M327333</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-14T20:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Polynomial regression: export estimated value and error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828641#M327338</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;says, don't do that! If you want something more flexible than a cubic polynomial, use a cubic B-spline. Many of the linear modeling procedures such as transreg and glmselect can easily do it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 02:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Polynomial-regression-export-estimated-value-and-error/m-p/828641#M327338</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2022-08-15T02:19:51Z</dc:date>
    </item>
  </channel>
</rss>

