Hello,
I have yearly panel data on 4 variables for all U.S. states, and the data are in wide format. There is some missing data, as some states failed to report information for a given variable-year, while other states missed large chunks of years. I am trying to linearly interpolate missing data, but only if a state has data for the year prior to and after the missing year (illustration below). Can someone help we with the code for specifying this IF condition?
State V1_1980 V1_1981 V1_1982 V1_1983 V1_1984
AK 1 Miss 7 14 19 <--- linearly interpolate
AL 10 Miss Miss 40 56 <--- do not linearly interpolate
Thank you for your help,
Tom
Related Posts with Problem specifying conditions with ipolate command
Extract Year from a string variableHi everyone, I would like to ask some help in order to extract year from a string variable (year of …
how to access STATA 16 sever through MAC terminalCurrently, I successfullly installed Stata on my server and can use "./stata" to initiate the progra…
FD-GMM vs sys-GMMDear all. Which kind of GMM method should I use to dynamic panel data? FD-GMM or sys GMM?Some people…
Question about datesI had a question about dates. Can someone suggest an efficient method to deal with this type of date…
Stacked graph bar with marginsplot ?Good morning everyone! I need your help for plotting the results of margins in a nice and straightf…
Subscribe to:
Post Comments (Atom)
0 Response to Problem specifying conditions with ipolate command
Post a Comment