Hello Statalist community,
I have panel data in which the groups are firms: there are 1s in the years in which there was a bankruptcy, and 0s everywhere else.
Quite often, the year in which I have my one (=bankruptcy) is a year where, naturally enough, there is no longer any data. For example, I will have a series for my X1....Xn explanatory variables from 1995 to 1999, for a bankruptcy in 2000. This is obviously problematic, since it will tend to be dropped from many estimations.
One logic that I have tried to explore is replace bankruptcy[_n-1]=F.bankruptcy if bankruptcy=1 & missing(x1). I then planned to make some sort of loop out of that.
STATA does not like this syntax, however. It's confess that it's pretty counterintuitive to replace the previous value, although that'd be the same as imposing conditions on future values (which I also tried).
Probably the answer is a whole different kind of code. Any suggestions?
Thank you so much for you help. I really appreciate it.
John
I have panel data in which the groups are firms: there are 1s in the years in which there was a bankruptcy, and 0s everywhere else.
Quite often, the year in which I have my one (=bankruptcy) is a year where, naturally enough, there is no longer any data. For example, I will have a series for my X1....Xn explanatory variables from 1995 to 1999, for a bankruptcy in 2000. This is obviously problematic, since it will tend to be dropped from many estimations.
One logic that I have tried to explore is replace bankruptcy[_n-1]=F.bankruptcy if bankruptcy=1 & missing(x1). I then planned to make some sort of loop out of that.
STATA does not like this syntax, however. It's confess that it's pretty counterintuitive to replace the previous value, although that'd be the same as imposing conditions on future values (which I also tried).
Probably the answer is a whole different kind of code. Any suggestions?
Thank you so much for you help. I really appreciate it.
John
Comment