Hi,
I am using the loess procedure to do some time series analysis, of the form:
proc loess data=table;
model dependent=time / smooth= 0.1 0.2;
ods output OutputStatistics=results;
run;
I have a macro array of values I would like to use as the smoothing parameters, i.e. &sparam = {0.05 0.1 0.2 0.5}.
My question is: is it possible to insert the values of the array into the procedure under the smooth option? When I currently write "smooth = &sparam," I receive an unresolved symbol error. When I try to list out the names of all of the array elements using a %do-put loop, I receive an error that the smooth option expects a numeric value.
Any suggestions for how to approach this? I cannot simply write in the numeric values under smooth since I am looping through many times using different calculated values.
Thanks!
Lucy
It is worked for me .
%let sparam = { 5 7 8 9 } ; %let fix_sp=%sysfunc(compress(&sparam,{} )); proc loess data=sashelp.buy; model amount=date / smooth= &fix_sp ; ods output OutputStatistics=results; run;
Ksharp
I did not end up using your method, but it is good to find out about the compress function.
Thanks!
Lucy
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.