Hi all,
I have tried finding a post already discussing this issue but have not found any; apologies in advance if one exists
Here is my data:
input float(SecId1 dm) double WeeklyReturn float tb3ms
4 705 .5516592499999999 2.25
4 706 .606598 2.33
4 707 -.4112093999999999 2.37
4 708 1.64722825 2.37
4 709 .33371999999999996 2.39
4 710 1.1331326000000002 2.4
4 711 .09498449999999997 2.38
4 712 -1.9586029999999999 2.35
4 713 1.67149 2.17
4 714 -1.3865355 2.1
4 715 -.34597675000000006 1.95
4 716 .21807700000000008 1.89
4 717 1.6438857500000001 1.65
4 718 -.02667074999999998 1.54
4 719 1.3116976 1.54
4 720 -1.0276205 1.52
4 721 -.9711949999999999 1.52
4 722 -3.6885015999999995 .29
4 723 2.11304575 .14
4 724 2.6366712 .13
4 725 .945435 .16
4 726 1.3224075 .13
4 727 .5792539999999999 .1
4 728 -.39374025 .11
4 729 .061644750000000026 .1
4 730 2.6141734000000003 .09
4 731 .96156325 .09
4 732 1.7286028000000002 .08
4 733 -.7715675000000002 .04
4 734 -.0966455 .03
4 735 .10510433333333336 .02
5 705 -.95295275 .
5 706 -.019057249999999915 .
5 707 -1.358661 .
5 708 1.3026425 .
5 709 .6011622499999999 .
5 710 .17128120000000008 .
5 711 -.054412 .
5 712 -2.04645475 .
5 713 1.3629257999999997 .
5 714 -.81613775 .
5 715 -.5691437500000001 .
5 716 .5598118000000001 .
5 717 1.3654247499999999 .
5 718 .3868075 .
5 719 .4214298 .
5 720 -.84145575 .
5 721 -1.54410075 .
5 722 -2.7440836 .
5 723 1.583352 .
5 724 1.9272106 .
5 725 -.7555624999999999 .
5 726 .09120900000000004 .
5 727 .8842686000000001 .
5 728 -.53119275 .
5 729 -.513367 .
5 730 2.970973 .
5 731 .19980999999999996 .
5 732 .5054336 .
5 733 .5529535 .
5 734 .6751975 .
5 735 .5922396666666666 .
SecId1 is the panel variable and dm the monthly variable.
tb3ms is the three month Treasury bill rate that I downloaded separately from the dataset and then pasted onto it. I would like to compute the excess return of each security i.e. WeeklyReturn - tb3ms.
For this, I would need to assign the same 31 values for tb3ms (one for each month) to each panel. How could this be achieved? I have tried using expand, which failed. I also tried using David Kantor's "carryforward" command, combined with tsfill, but this also failed.
I would greatly appreciate any help!
Best regards,
Maxence
Related Posts with Assigning Values of Variable for All Panels
What fixed effects I should add when using triple difference in firm level?In my difference-in-difference setting (double diff), I examine the impact of anticorruption laws on…
coefplot plotting results from categorical variableDear all, I would like to use coefplot to compare the coefficients from different models and catego…
What is the difference between "stack" and "pca" ?From my understanding, it seems that pca and stack syntaxes are all about suppressing two or more va…
Labels of restricted categories appearing in graph when using -by()-I want to graph tobacco use for couples in different value groups. While the values variable has 12 …
Is there any package for stacked event-by-event estimates ?I am reading a paper of Cengiz, 2019 about using stacked event-by-event estimates for the Difference…
Subscribe to:
Post Comments (Atom)
0 Response to Assigning Values of Variable for All Panels
Post a Comment