Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to compute yearly (and two year) returns starting five months after the fiscal year end for each firm?

    Hello,

    So I want to compute returns for individual firms and then portfolios, starting five months after their fiscal year end.

    My data for this looks like this;

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long globalkey int fyear byte fyearendmonthhistoric float(monthlypriceclose date)
    1000 1961 12      .  730
    1000 1962 12      . 1095
    1000 1963 12      . 1460
    1000 1964 12      . 1826
    1000 1965 12      . 2191
    1000 1966 12      . 2556
    1000 1967 12      . 2921
    1000 1968 12      . 3287
    1000 1969 12      . 3652
    1000    .  .  11.75 3925
    1000    .  .   12.5 3956
    1000    .  .      9 3986
    1000    .  .      9 4048
    1000    .  . 11.125 4076
    1000    .  .   9.75 4107
    1000    .  .  10.75 4137
    1000    .  .  8.625 4168
    1000    .  .   8.25 4198
    1000    .  .  6.125 4229
    1000    .  .   5.25 4260
    1000    .  .  4.625 4290
    1000    .  .  4.875 4321
    1000    .  .  4.125 4351
    1000    .  .   5.75 4413
    1000    .  .   5.25 4442
    1000    .  .  5.625 4473
    1000    .  .  7.125 4503
    1000    .  .  6.625 4534
    1000    .  .      6 4564
    1000    .  .      6 4595
    1000    .  .  5.875 4626
    1000    .  .   5.25 4656
    1000    .  .  5.625 4687
    1000    .  .    5.5 4717
    1000    .  .  5.125 4779
    1000    .  .   4.25 4807
    1000    .  .  4.375 4838
    1000    .  .  3.375 4868
    1000    .  .  3.125 4899
    1000    .  .      3 4929
    1000    .  .  3.875 4960
    1000    .  .  2.875 4991
    1000    .  .      3 5021
    1000    .  .    2.5 5052
    1000    .  .   1.75 5082
    1000 1973 12   1.75 5113
    1000    .  .   2.25 5144
    1000    .  .    2.5 5172
    1000    .  .  2.625 5203
    1000    .  .  2.875 5233
    1000    .  .    2.5 5264
    1000    .  .  2.625 5294
    1000    .  .   2.25 5325
    1000    .  .  2.625 5356
    1000    .  .  2.125 5386
    1000    .  .   2.25 5417
    1000    .  .   2.25 5447
    1000 1974 12  2.125 5478
    1000    .  .  2.125 5509
    1000    .  .  2.625 5537
    1000    .  .      3 5568
    1000    .  .   2.75 5598
    1000    .  .    2.5 5629
    1000    .  .  2.875 5659
    1000    .  .    3.5 5690
    1000    .  .   3.25 5721
    1000    .  .      4 5751
    1000    .  .   4.25 5782
    1000    .  .   4.25 5812
    1000 1975 12  4.375 5843
    1000    .  .    4.5 5874
    1000    .  .   6.25 5903
    1000    .  .   6.75 5934
    1000    .  .  6.875 5964
    1000    .  .      6 5995
    1000    .  .   7.25 6025
    1000    .  .    7.5 6056
    1000    .  .    7.5 6087
    1000    .  .  7.125 6117
    1000    .  .  5.875 6148
    1000    .  .  5.375 6178
    1000 1976 12   5.75 6209
    1000    .  .  6.125 6240
    1000    .  .      6 6268
    1000    .  .   6.25 6299
    1000    .  .   5.75 6329
    1000    .  .  6.125 6360
    1000    .  .    6.5 6390
    1000    .  .      8 6421
    1000    .  .  8.375 6452
    1000    .  .      9 6482
    1000    .  .  8.625 6513
    1000    .  .  8.625 6543
    1000    .  .  9.125 6605
    1000    .  .  8.875 6633
    1000    .  .  8.875 6664
    1000    .  .  9.125 6694
    1000    .  .   9.25 6725
    1000    .  .  9.375 6755
    1000    .  .      . 6786
    end
    format %td date
    Note. fyearendmonthhistoric indicates the end month of the fiscal year for that given fiscal year. The globalkey indicates the firm. Data has been sorted based on the globalkey and date.

    I have been stuck on this for a couple of days now... So I really hope someone can help.

    thank you in advance,

    Julien.
    Last edited by Julien Maas; 11 May 2023, 05:35.
Working...
X