Hey everyone,
assume the following MWE from a panel data set:
I'd like to fill the missing values for my price variable between two equal occurrences. In this example, for instance, the price in 2000m2 and 2000m3 should be filled with the value 1, as this is the price from 2000m1 reoccurring in 2000m4. Note, however, that looking at ID 456 2000m1 and 2000m2 should stay missing as there is no preceding, non-missing observation for id = 456 before 2000m1 obiviously.
I'd be really grateful for ideas.
Thanks!
Carlo
assume the following MWE from a panel data set:
Code:
input id price month year 123 1 1 2000 123 . 2 2000 123 . 3 2000 123 1 4 2000 123 . 5 2000 123 2 6 2000 123 2 7 2000 456 . 1 2000 456 . 2 2000 456 1.5 3 2000 456 3 4 2000 456 . 5 2000 456 . 6 2000 456 3 7 2000 end
I'd be really grateful for ideas.
Thanks!
Carlo
Comment