I am quite new with stata, and after a couple of days trying to fix a problem without any success I decided to post my problem here.
Basically, I have a panel dataset where permno identifies the companies, and BM indicates the book to market value of each company which is calculated in December of each year.
In accordance with my purpose, for each company the BM for month t from June of year t+1 through May of the year t+2 is taken to be the book to market ratio calculated in December of year t.
Therefore I am not able to replace the BM value calculated in December of year t in June of year t+1 through May t+2.
This replacement should be done for each company as well.
Any help would be really appreciated.
Kind regards
permno | date | year | month | BM |
10001 | 30-Apr-87 | 1987 | 4 | |
10001 | 29-May-87 | 1987 | 5 | |
10001 | 30-Jun-87 | 1987 | 6 | |
10001 | 31-Jul-87 | 1987 | 7 | |
10001 | 31-Aug-87 | 1987 | 8 | |
10001 | 30-Sep-87 | 1987 | 9 | |
10001 | 30-Oct-87 | 1987 | 10 | |
10001 | 30-Nov-87 | 1987 | 11 | |
10001 | 31-Dec-87 | 1987 | 12 | 1.207618 |
10001 | 29-Jan-88 | 1988 | 1 | |
10001 | 29-Feb-88 | 1988 | 2 | |
10001 | 31-Mar-88 | 1988 | 3 | |
10001 | 29-Apr-88 | 1988 | 4 | |
10001 | 31-May-88 | 1988 | 5 | |
10001 | 30-Jun-88 | 1988 | 6 | |
10001 | 29-Jul-88 | 1988 | 7 | |
10001 | 31-Aug-88 | 1988 | 8 | |
10001 | 30-Sep-88 | 1988 | 9 | |
10001 | 31-Oct-88 | 1988 | 10 | |
10001 | 30-Nov-88 | 1988 | 11 | |
10001 | 30-Dec-88 | 1988 | 12 | 1.145192 |
10001 | 31-Jan-89 | 1989 | 1 | |
10001 | 28-Feb-89 | 1989 | 2 | |
10001 | 31-Mar-89 | 1989 | 3 | |
10001 | 28-Apr-89 | 1989 | 4 | |
10001 | 31-May-89 | 1989 | 5 |
0 Response to Value Replacement
Post a Comment