<?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: Trend function Excel equivalent in SAS. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968950#M376699</link>
    <description>&lt;P&gt;I search this function at internet and found it is just a ordinal least square model(a.k.a a linear regression model).&lt;/P&gt;
&lt;P&gt;Here could give you a start.&lt;/P&gt;
&lt;PRE&gt;data train;
input y x;
cards;
1 2
2 4
3 4
5 1
2 2
;
data test;
input x;
cards;
3
5
2
5
6
;

data all;
 set train test;
run;
proc reg data=all;
model y=x;
output out=want p=pred;
quit;

proc print;run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1749778872346.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107804i099AF0E709B5279F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1749778872346.png" alt="Ksharp_0-1749778872346.png" /&gt;&lt;/span&gt;&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;</description>
    <pubDate>Fri, 13 Jun 2025 01:41:45 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-06-13T01:41:45Z</dc:date>
    <item>
      <title>Trend function Excel equivalent in SAS.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968858#M376655</link>
      <description>&lt;P&gt;Hello ALL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with excel TREND function equivalent in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;formulae in excel is :&amp;nbsp; TREND($B$9:$S$9,$B$10:$S$10,B13,TRUE).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;9th row is&amp;nbsp; historical %values of one variable,&amp;nbsp; 10th row is&amp;nbsp;historical %values of another variable and 13th row is current month value of variable.&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 15:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968858#M376655</guid>
      <dc:creator>Vik_3010</dc:creator>
      <dc:date>2025-06-12T15:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trend function Excel equivalent in SAS.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968870#M376658</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/475761"&gt;@Vik_3010&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello ALL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me with excel TREND function equivalent in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;formulae in excel is :&amp;nbsp; TREND($B$9:$S$9,$B$10:$S$10,B13,TRUE).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;9th row is&amp;nbsp; historical %values of one variable,&amp;nbsp; 10th row is&amp;nbsp;historical %values of another variable and 13th row is current month value of variable.&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What statistic does the TREND() function in EXCEL calculate?&lt;/P&gt;
&lt;P&gt;What is the meaning of the four arguments that you show using in your function call?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are the names of the VARIABLES in your SAS dataset that you want to use as input.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 15:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968870#M376658</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-12T15:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trend function Excel equivalent in SAS.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968950#M376699</link>
      <description>&lt;P&gt;I search this function at internet and found it is just a ordinal least square model(a.k.a a linear regression model).&lt;/P&gt;
&lt;P&gt;Here could give you a start.&lt;/P&gt;
&lt;PRE&gt;data train;
input y x;
cards;
1 2
2 4
3 4
5 1
2 2
;
data test;
input x;
cards;
3
5
2
5
6
;

data all;
 set train test;
run;
proc reg data=all;
model y=x;
output out=want p=pred;
quit;

proc print;run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1749778872346.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107804i099AF0E709B5279F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1749778872346.png" alt="Ksharp_0-1749778872346.png" /&gt;&lt;/span&gt;&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;</description>
      <pubDate>Fri, 13 Jun 2025 01:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/968950#M376699</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-06-13T01:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trend function Excel equivalent in SAS.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/969676#M376915</link>
      <description>Hi Ksharp.&lt;BR /&gt;&lt;BR /&gt;Thanks for the solution. It worked.</description>
      <pubDate>Wed, 25 Jun 2025 15:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trend-function-Excel-equivalent-in-SAS/m-p/969676#M376915</guid>
      <dc:creator>Vik_3010</dc:creator>
      <dc:date>2025-06-25T15:08:52Z</dc:date>
    </item>
  </channel>
</rss>

