Hi all!
I have some time series data with which I want to plot the means and medians. I am wondering if you are able to call upon the mean and median (and other functions) within the proc sgplot?
For instance, I have the following code where I am making 14 separate line plots :
%Macro Line(ET);
proc sgplot data = Sub.Tall_M_IndEXP_Better_JB_011119;
where ExpenseType like &ET;
series x = Month y = mean(Value) / group= Trichot_1YR curvelabel;
xaxis values =(1 to 12 by 1);
run;
%mend;
%Line('Tax')
%Line('Trans')
I am getting an error when trying to utilize the function in this way that states that the variable MEAN is not found. The way around it is simply take the means before and utilize this new data, but it had me thinking if you could utilize these functions in the middle of a Proc step?
I was hoping that someone would be able to explain to me why or why not as I am still trying to learn the intricacies of SAS.
Like always, if you see any problems/inefficiencies in my code, please point it out! I am always trying to learn. Also, thank you in advance!