Kyle
a note of caution
a return of +10% followed by -10% might not average at an average return of zero, but to -.5%
This is because rates of return are usually considered cumulative. 1.5% per month is not 18% per year but the product of 1.5% each month like
(1.015)**12 -1 =19.56%
Typically the compound rate over a period is a bit like
(1+rate1/100)*(1+rate2/100)*(1+rate3/100) -1
To express this as an average per period, we take the N-th root of the product of N periods, which in SAS syntax, would be like:
( (1+rate1/100)*(1+rate2/100)*(1+rate3/100) ) ** ( 1/3 ) for the average over 3 periods.
This kind of average rate of return can be measured in a data step, like
data ave_returns ;
input aveReturn ;
format simple_ave_return 8.2 cum_ave_return percent8.2 ;
simple_cum + aveReturn ;
simple_ave_return = simple_cum / _n_ ;
* for (more correct= compound) average return ;
retain compounder 1 ;
compounder = compounder * (1 + aveReturn/100 ) ;
cum_ave_return = compounder ** ( 1/_n_) -1 ;
cards/* your numbers follow*/ ;
;
run ;
proc print ;
run ;
SAS has some financial functions which can help when your "rates" are available within the observation. For Internal Rate of Return, see
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245904.htm
peterC