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
How to set that I have cross-sectional database from different yearHello Guys, I have cross-sectional observations from 10 different years. As the respondents vary ye…
Defining a variable fitting to the size of a matrixHey everyone, im still new to stata so this is probably still a trivial question . for further compu…
Problem with omitted variables during regressionDear Stata-listers, Iam currently analysing impact of access to microfinance institution to consumpt…
Quick question: how to let stata read months?Hello! I hope someone here is able to help me out with this matter. I have a research where I am tr…
Correct for optimism in prediction modelling using bootstrapping (bsample command), is this the correct approach?Dear statalist users, I have a question about the bsample command in STATA. I want to use this comm…
Subscribe to:
Post Comments (Atom)
0 Response to Problem specifying conditions with ipolate command
Post a Comment