I am dealing with panel data of 20000 firms for period 2010-2015. I found the identity of some firms (e.g. industrial code) are missing in particular year. I would like to replace missing identity by the information from the previous year or from the following year. I did the following command:
Code:
list firmcode if indcode==.
from this command, I can get list of firmcode whose industrial code is missing. I got more than 100 firms. Then, in order to check and edit I did the following command:
Code:
edit year firmcode indcode if firmcode==44|firmcode==45|firmcode==46
I need to repeat the second command many times until I finish editing more than 100 firms.
If you have a more efficient command, would you please share with me?
I have to check and edit the missing value of other variables too with the same procedure. I will appreciate your help.
Best regard,
Aisah
0 Response to how to replace missing value by using the information in previous or following year?
Post a Comment