Hello everybody,
I got a dataset with the montly return of 365 stocks over 28 years. I've calculated the market beta (b_monatlich2) for the stocks and allocated the stocks into ten decile portfolios based on their betas (for each month). Now I need to calculate the monthly excess returns of this portfolios. u_m=excess return
To get the decile Portfolios I've used astile and xtile, which gave me the same results:
Beta10 ranges from 1 to 10 for each year (over the 365 stocks). The montly portfolio should be stored in ten variables (P1 to P10).
Thank you in advance!
I got a dataset with the montly return of 365 stocks over 28 years. I've calculated the market beta (b_monatlich2) for the stocks and allocated the stocks into ten decile portfolios based on their betas (for each month). Now I need to calculate the monthly excess returns of this portfolios. u_m=excess return
To get the decile Portfolios I've used astile and xtile, which gave me the same results:
Code:
egen beta10= xtile(b_monatlich2), by(Monat) nq(10)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float date2 long business float(u_m beta10) 360 251 -.003713793 1 360 310 -.005739493 1 360 271 -.0017437707 1 360 17 -.0041152965 1 360 215 -.00026 1 360 361 -.00026 1 360 103 -.002382601 1 360 289 -.006916477 1 360 291 -.00026 1 360 29 -.00026 1 360 68 -.00026 1 360 365 -.00026 1 360 24 -.005031573 2 360 301 -.00026 2 360 75 -.00026 2 360 269 -.00026 2 360 138 -.00026 2 360 308 -.00026 2 360 93 .014447267 2 360 48 -.00026 2 360 160 -.00029503205 2 360 298 -.0039577777 2 360 131 -.00026 2 360 57 -.006493726 2 360 178 -.00026 2 360 307 -.00494 2 360 141 -.00026 2 360 94 -.005751215 2 360 177 -.008883337 2 360 175 -.005992248 2 360 192 -.005398897 2 end format %tm date2 label values business business label def business 17 "amel", modify label def business 24 "aon", modify label def business 29 "aqam", modify label def business 48 "blhi", modify label def business 57 "brin", modify label def business 68 "center", modify label def business 75 "cinc", modify label def business 93 "coop", modify label def business 94 "copa", modify label def business 103 "cuwr", modify label def business 131 "ever", modify label def business 138 "fedr", modify label def business 141 "first", modify label def business 160 "hall", modify label def business 175 "hubb", modify label def business 177 "huma", modify label def business 178 "hunt", modify label def business 192 "jms", modify label def business 215 "max", modify label def business 251 "oge", modify label def business 269 "pop", modify label def business 271 "ppl", modify label def business 289 "sbd", modify label def business 291 "sea", modify label def business 298 "shwi", modify label def business 301 "smith", modify label def business 307 "sta", modify label def business 308 "stif", modify label def business 310 "suba", modify label def business 361 "wiso", modify label def business 365 "zions", modify
Thank you in advance!
Comment