Good morning,
I have Monthly excess returns of two portfolios P1 and P8 over 29 years. For my master thesis I have to state the Volatilities and SR in one number, while these two numbers should be annualized. So far I have tried different approaches to calculate the needed results but I'm not sure which is the formally correct code to do so.
Here is an example of the code (for Portfolio P1) I think is correct and the data from 1990 and 1991. I know the Code Looks Kind of sloppy but I will put the calculations into loops later on.
I think I am using the wrong scaling somewhere, even though the results look Kind of reasonable.
I have Monthly excess returns of two portfolios P1 and P8 over 29 years. For my master thesis I have to state the Volatilities and SR in one number, while these two numbers should be annualized. So far I have tried different approaches to calculate the needed results but I'm not sure which is the formally correct code to do so.
Here is an example of the code (for Portfolio P1) I think is correct and the data from 1990 and 1991. I know the Code Looks Kind of sloppy but I will put the calculations into loops later on.
Code:
egen Sd_P1= sd(P1), by(Jahr) gen Sd_Annual= Sd_P1*sqrt(12) gen SR= P1/Sd_P1 gen SR_annual= SR*sqrt(12) egen SR_final= mean(SR_annual) //To get my SD for P1 gen SD_final= Sd_Annual*sqrt(29) * Example generated by -dataex-. To install: ssc install dataex clear input float(date Jahr Monat P1 P8) 360 1990 1 -.0019377362 -.003668688 361 1990 2 .0008372813 .001459499 362 1990 3 -.00022618668 .0019396635 363 1990 4 -.0003067676 -.002378969 364 1990 5 .0004768702 .005065726 365 1990 6 .0006901055 -.00016673017 366 1990 7 -.0012268435 -.0008285865 367 1990 8 -.0027135995 -.005536701 368 1990 9 -.0011730944 -.004750926 369 1990 10 -.0017754886 .0002686236 370 1990 11 .0014749074 .005864478 371 1990 12 .0004333424 .0011803983 372 1991 1 .0016687294 .005055216 373 1991 2 .0041755983 .005791987 374 1991 3 .0020613207 .0019960906 375 1991 4 .002639579 .00008909535 376 1991 5 .00054460054 .002296731 377 1991 6 .00011390844 -.0020861127 378 1991 7 .000027179554 .0012150153 379 1991 8 .0017399964 .0015752286 380 1991 9 -.00013826239 .0004809036 381 1991 10 -.0008881435 .0013854794 382 1991 11 -.00016042936 -.002432231 383 1991 12 .000421264 .004964425 end format %tm date
Comment