How to sum the Quarter values into Year values in SAS? Proc SQL? -
i have info set contains quarterly info value. want sum quarterly values have same year.
data :
time value 1990q1 34 1990q2 12 1990q3 25 1990q4 14 2001q1 29 2001q2 27 2001q3 39 2001q4 20
what want sum quarterly info year. this:
time value 1990 217 2001 194
is there proc sql this?
yes, create new variable represent year , utilize in grouping clause. can calculate year using substr function.
proc sql; create table want select substr(time, 1,4) qtr, sum(value) total have grouping calculated qtr; quit;
sql sum sas
No comments:
Post a Comment