Hello ALL.
Can anyone help me with excel TREND function equivalent in SAS.
formulae in excel is : TREND($B$9:$S$9,$B$10:$S$10,B13,TRUE).
9th row is historical %values of one variable, 10th row is historical %values of another variable and 13th row is current month value of variable.
Thank you.
I search this function at internet and found it is just a ordinal least square model(a.k.a a linear regression model).
Here could give you a start.
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;
@Vik_3010 wrote:
Hello ALL.
Can anyone help me with excel TREND function equivalent in SAS.
formulae in excel is : TREND($B$9:$S$9,$B$10:$S$10,B13,TRUE).
9th row is historical %values of one variable, 10th row is historical %values of another variable and 13th row is current month value of variable.
Thank you.
What statistic does the TREND() function in EXCEL calculate?
What is the meaning of the four arguments that you show using in your function call?
What are the names of the VARIABLES in your SAS dataset that you want to use as input.
I search this function at internet and found it is just a ordinal least square model(a.k.a a linear regression model).
Here could give you a start.
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;
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.