I have a dataset with 2 variables, 'Month' and 'Factor'. 'Month' is from 0 to 100, for our sake. Example:
Month Factor
0 5
1 3.4
2 5.6
3 6.5
4 1.2
5 0.8
6 0.9
.
.
.
How can I make a third variable (probably using arrays) that will sum 'factor' from month(current) to month(last). For month 0, newvariable=5+3.4+5.6+...., month 1 newvariable=3.4+5.6+6.5....., month2 newvariable=5.6+6.5+1.2+.....
Month Factor
0 5
1 3.4
2 5.6
3 6.5
4 1.2
5 0.8
6 0.9
.
.
.
How can I make a third variable (probably using arrays) that will sum 'factor' from month(current) to month(last). For month 0, newvariable=5+3.4+5.6+...., month 1 newvariable=3.4+5.6+6.5....., month2 newvariable=5.6+6.5+1.2+.....
SAS coding help?
0 commentaires:
Enregistrer un commentaire