Hi,
I have a dataset of a portfolio (P1Low) with monthly returns and I regress (OLS time-series regression) these on monthly macroeconomic variables such as the default spread and the TED spread in order to make inferences on the effects of these macroeconomic variables on my portfolio returns.
It was brought to my attention that instead of using monthly returns, I am better off using longer-period returns such as 6 or 12 month returns. This is because using monthly returns would too easily give me statistically insignificant results and by using longer period returns I will better be able to get statistically significant coefficients.
So basically I'm seeking to get monthly observations of 12 month (or 6 month) returns in my dataset, whereas now I only have monthly observations of monthly (1 month) returns in my dataset.
So I want to get something like:
So basically as you can see, the ted variable is given in percentages and the P1LowQual (the monthly returns of my portfolio) is given in decimals and I'm hoping to get the 12 month returns for each monthly observation in my dataset.
If anyone could help transforming these monthly returns to 12 or 6 month returns, it would be really appreciated!
Thanks in advance.
Please find a subset of my data below:
I have a dataset of a portfolio (P1Low) with monthly returns and I regress (OLS time-series regression) these on monthly macroeconomic variables such as the default spread and the TED spread in order to make inferences on the effects of these macroeconomic variables on my portfolio returns.
It was brought to my attention that instead of using monthly returns, I am better off using longer-period returns such as 6 or 12 month returns. This is because using monthly returns would too easily give me statistically insignificant results and by using longer period returns I will better be able to get statistically significant coefficients.
So basically I'm seeking to get monthly observations of 12 month (or 6 month) returns in my dataset, whereas now I only have monthly observations of monthly (1 month) returns in my dataset.
So I want to get something like:
mdate | ted | P1LowQual | P1LowQual12monthreturns |
1996m10 | 0.56 | -0.0296 | These are the returns I'm hoping to get by transforming the monthly returns in the column on the left to 12 month returns. |
1996m11 | 0.47 | 0.0202 | 12 month returns |
1996m12 | 0.64 | 0.0002 | 12 month returns |
1997m1 | 0.53 | 0.0333 | 12 month returns |
1997m2 | 0.51 | -0.0351 | 12 month returns |
1997m3 | 0.48 | -0.0603 | 12 month returns |
1997m4 | 0.67 | -0.0197 | 12 month returns |
So basically as you can see, the ted variable is given in percentages and the P1LowQual (the monthly returns of my portfolio) is given in decimals and I'm hoping to get the 12 month returns for each monthly observation in my dataset.
If anyone could help transforming these monthly returns to 12 or 6 month returns, it would be really appreciated!
Thanks in advance.
Please find a subset of my data below:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float mdate double(P1LowQual ted) 429 -.0538636220884761 .6614285714285715 430 .0312862682166129 .5228571428571429 431 .0251179455815762 .6057894736842105 432 .0253296909078278 .5457142857142857 433 .0102688159894037 .449 434 .0041491010401756 .4319047619047619 435 .0413087388243543 .548 436 .021981885241557 .48 437 -.0479455209481128 .476 438 -.103168701512015 .49318181818181817 439 .05115458410782 .48095238095238096 440 .0300199178062636 .5285 441 -.0296442484877601 .5595454545454546 442 .0201793968115397 .47157894736842104 443 .000230958511322175 .643 444 .0332868564812662 .5290476190476191 445 -.0351360509156712 .5057894736842106 446 -.0603476013433256 .4826315789473684 447 -.0196731638539422 .6677272727272727 448 .0923973584398753 .7695 449 .0515543444029879 .9104761904761904 450 .0611489774411407 .6931818181818182 451 -.00526129431229295 .585 452 .0882953807640011 .7723809523809524 453 -.0401725210004555 .7931818181818182 454 -.0247051017798223 .6961111111111111 455 -.00975174806711184 .7495238095238095 456 -.00887751305898222 .6145 457 .0702827778250254 .5473684210526316 458 .0534783275942953 .6581818181818182 459 -.00356642904176805 .746 460 -.0502053993706615 .6905263157894737 461 .0269058657200001 .7163636363636363 462 -.0327539933050065 .7277272727272728 463 -.222981085705437 .7775 464 .0936062742681193 .888095238095238 465 .0626636234331248 1.3076190476190477 466 .0511319880234422 .9084210526315789 467 .0921776073317715 .84 468 .0870461873239644 .6710526315789473 469 -.0494245167344036 .5568421052631579 470 .0459596425688051 .5643478260869565 471 .0900811724061429 .711 472 -.0487733795450576 .5247368421052632 473 .0233662433951308 .6122727272727273 474 -.0644007592524489 .758095238095238 475 -.0552143363001121 .7342857142857143 476 -.0178123456408532 .8914285714285715 477 .0981899414140518 1.321 478 .0449155447505022 1.0325 479 .132956118946866 .9326315789473684 480 -.0176354861184495 .7189473684210527 481 .118148528225896 .5515 482 -.0132442965534046 .5021739130434782 483 -.156519009195294 .65 484 -.123080983258707 .959047619047619 485 .121473762402611 1.1036363636363635 486 -.0738952841367752 .775 487 .0907534225285337 .5990909090909091 488 -.115453634773319 .6775 489 -.133065289748952 .67 490 -.269220663418234 .58 491 .00978850054772275 .7684210526315789 492 .156811022446877 .550952380952381 493 -.19858702281143 .46421052631578946 494 -.127497788861056 .5395454545454546 495 .0975596105336919 .7510526315789474 496 -.0218311749465995 .4847619047619048 497 -.0457572415365201 .35 498 -.0838297194695795 .23476190476190476 499 -.0992125942877788 .205 500 -.170099741958005 .34647058823529414 501 .0520579735012199 .2409090909090909 502 .113354755611346 .2335 503 .0220613480664091 .23526315789473684 504 -.0973863157962901 .1680952380952381 505 -.0830924960725977 .17789473684210527 506 .0582260535339515 .2005 507 -.0726927461264192 .25523809523809526 508 -.0642396266684592 .17857142857142858 509 -.162658044466438 .1811111111111111 510 -.155221610414267 .16454545454545455 511 .0338501786322576 .16 end format %tm mdate
Comment