Dear Statalisters,
Any thoughts on this problem where I want to fill in the missing observations in a dataset only if the boundary nonmissing observations are the same. Consider the example dataset below
I would want to fill the missing observations in the dataset so that 40 is carried forward only if the next non-missing observation is 40. ..The value 40 is not carried forward in the next missing set (in obs 5 and 6) as the next non-missing value is not 40. To get dataset as below
1 40
2 40
3 40
4 40
5 .
6 .
7 35
thanks in advance for advice.
regards
Ram
Any thoughts on this problem where I want to fill in the missing observations in a dataset only if the boundary nonmissing observations are the same. Consider the example dataset below
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(sn x) 1 40 2 . 3 . 4 40 5 . 6 . 7 35 end
I would want to fill the missing observations in the dataset so that 40 is carried forward only if the next non-missing observation is 40. ..The value 40 is not carried forward in the next missing set (in obs 5 and 6) as the next non-missing value is not 40. To get dataset as below
1 40
2 40
3 40
4 40
5 .
6 .
7 35
thanks in advance for advice.
regards
Ram
Comment