Hi all,
I am struggling with the following situation. I have this data where Annualized monhtly returns are calculated per fiscal year per gvkey (firm).
The problem is that I need all cells covered with the same Annualized monthly return per fiscal year per gvkey but currently only one cell per fiscal year per gvkey is covered.
Attached, you'll find examples of the data. For the first company with gvkey 1004 I already did some work by hand so that you know what I mean.
I know the gvkey, fyear and Annualized returns are duplicates but that is because I have other data in my master data set as well. I first need this and in the end I will drop all duplicates.
Is there anyone out there that knows how to code this in stata? I cannot do this manally for 850,000 observations.
I hope someone can help me out here.
Thanks in advance,
Best,
Roy Steinvoort
Filled out manually:

Also want the cells to be like in the picture above:
I am struggling with the following situation. I have this data where Annualized monhtly returns are calculated per fiscal year per gvkey (firm).
The problem is that I need all cells covered with the same Annualized monthly return per fiscal year per gvkey but currently only one cell per fiscal year per gvkey is covered.
Attached, you'll find examples of the data. For the first company with gvkey 1004 I already did some work by hand so that you know what I mean.
I know the gvkey, fyear and Annualized returns are duplicates but that is because I have other data in my master data set as well. I first need this and in the end I will drop all duplicates.
Is there anyone out there that knows how to code this in stata? I cannot do this manally for 850,000 observations.
I hope someone can help me out here.
Thanks in advance,
Best,
Roy Steinvoort
Filled out manually:
Also want the cells to be like in the picture above:
Comment