I have the following problem:
I have a panel data set which is "balanced between starts and ends" meaning to say there are data gaps for single firms in some years but these are filled with NAs.
Now I would like to calculate an index with the data of the preceding year. If the preceding year is a gap, I want to use the data of the first available data in the preceding years. However, data gaps not only occur with a duration of one year but can also be up to six years in duration.
How can I tell eviews to find the first available data record in the preceding years.
I thought of something like this:
Code: Select all
smpl if output_ges<>0 and output_ges(-1)=na
for !j=2 to 6
if output_ges(-!j)<>na then
exitloop
endif
next
genr output_ges_la=output_ges(-!j)Any ideas on how to solve this?
Thanks!
