t********1 发帖数: 799 | 1 there is a table with different variables as below,
yyyymmm, value1(%), value2(%), value3(%), .......
now I need to calculate every three observations' accummulated percent, i.e.
quarterly accummulated percent for value1,value2, value3,.....
How can I realize this? Thank you very much. | d******9 发帖数: 404 | 2 First group the date variable yyyymmm into 4 quarters, then roll up to the
analysis variables Value1-3 to the quarter level. | d******9 发帖数: 404 | 3 For example,use Format to group first
Proc Format;
Value Quarter
m1-m2='Q1'
m2-m3='Q2'
m3-m4='Q3'
m4-m5='Q4';
run;
Data B;
Set A;
quarter=put(yyymmm, quarter.);
run;
proc sql;
create table C as
select quarter, sum(value1) as CV1, sum(value2) as CV2, sum(value3) as CV3
from B
group by quarter;
quit; | t********1 发帖数: 799 | 4 thank you so much. Baozi is sent.
【在 d******9 的大作中提到】 : For example,use Format to group first : Proc Format; : Value Quarter : m1-m2='Q1' : m2-m3='Q2' : m3-m4='Q3' : m4-m5='Q4'; : run; : Data B; : Set A;
|
|