Hello, this question sounds stupid but I have already spent the whole weekend and still couldn't figure it out.
My data set: Unbalanced panel data with firm-monthly obs. For each firm, initially it has the fiscal year period with corresponding accounting data and monthly return. Additionally, for each firm each fiscal year, I get -24 to +36 monthly return. So even if the accounting info is missing, the firm still has -24 and/or +36 returns. Each firm has different fiscal year end and beginning month.
My question is: I have a variable "date", which is the date of the obs of monthly return. For example, now I have "date" started from Apr 1988 to May 1993. From Apr 1990 to Mar 1991, I also have fiscal year date "datadate" with accounting info. Other than that, all accounting info are missing. Now I want to know the interval between Apr 1988 to Apr 1990(fiscal year starts) , ideally which could be marked as -24,-23,-22..... and I want to know the interval between Mar 1991(fiscal year ends) to May 1993, ideally which could be 1, 2, 3.....
Notice each firm has different fiscal year end and starts, and the period before/after a fiscal year may not be exactly between -24 to 36 months because of missing data.
Could anyone please tell me how to do that? I almost freak out and I tried different ways to sort the variable but different fiscal year end and missing data in pre-fiscal year (not necessary -24 months) are causing the problem. I really appreciate anyone could help me and share me you ideas.
Thank you so much
My data set: Unbalanced panel data with firm-monthly obs. For each firm, initially it has the fiscal year period with corresponding accounting data and monthly return. Additionally, for each firm each fiscal year, I get -24 to +36 monthly return. So even if the accounting info is missing, the firm still has -24 and/or +36 returns. Each firm has different fiscal year end and beginning month.
My question is: I have a variable "date", which is the date of the obs of monthly return. For example, now I have "date" started from Apr 1988 to May 1993. From Apr 1990 to Mar 1991, I also have fiscal year date "datadate" with accounting info. Other than that, all accounting info are missing. Now I want to know the interval between Apr 1988 to Apr 1990(fiscal year starts) , ideally which could be marked as -24,-23,-22..... and I want to know the interval between Mar 1991(fiscal year ends) to May 1993, ideally which could be 1, 2, 3.....
Notice each firm has different fiscal year end and starts, and the period before/after a fiscal year may not be exactly between -24 to 36 months because of missing data.
Could anyone please tell me how to do that? I almost freak out and I tried different ways to sort the variable but different fiscal year end and missing data in pre-fiscal year (not necessary -24 months) are causing the problem. I really appreciate anyone could help me and share me you ideas.
Thank you so much
Comment