Hello everyone!
I am working with panel data. I need to create a dummy variable from the "balances" variable. The "balances" variable shows values and missings for 36 months for each person. The dummy must be a variable that takes the value of one from the first observation greater than zero until the panel ends. That is, if there are panels full of missings, everything should be zero. Additionally, all observations before the first value greater than zero should be zero. But if there are missings after the first observation greater than zero, it should take the value of one. This for each individual analyzed. Thank you very much for your help!
I am working with panel data. I need to create a dummy variable from the "balances" variable. The "balances" variable shows values and missings for 36 months for each person. The dummy must be a variable that takes the value of one from the first observation greater than zero until the panel ends. That is, if there are panels full of missings, everything should be zero. Additionally, all observations before the first value greater than zero should be zero. But if there are missings after the first observation greater than zero, it should take the value of one. This for each individual analyzed. Thank you very much for your help!
Comment