Hello, @Astounding helped me use a monthly return value in my firm performance dataset to create a variable for annualized return. Here is the code he provided, which worked: data paper.CSRP_Monthly_Stock;
set paper.CSRP_Monthly_Stock;
by ticker date;
retain annual_return 1;
annual_return = annual_return * (1 + RET);
month = int( mod(date,10000) / 100);
if month = 12 or last.ticker;
annual_return = (annual_return - 1) * 100;
output;
annual_return = 1;
run; How can I use this code to calculate the geometric mean of the monthly values instead? (which takes several values and multiplies them together and sets them to the 1/nth power). This is how my professor wishes to see the annualized return calculated. Thanks in advance for the help!
... View more