Hello everyone. I am so sorry to ask again.....
I have a set of data. Some of them have missing values. I want to move up the non-missing values while keeping the "state" 1-10 (without delete it). So I just use nonmissing to fill in the missing data without deleting the state. The dataset example is:
I'd like to change it to
Could someone please help how to write the command?
thankyou in advance
bestregards
nang
I have a set of data. Some of them have missing values. I want to move up the non-missing values while keeping the "state" 1-10 (without delete it). So I just use nonmissing to fill in the missing data without deleting the state. The dataset example is:
| id | state | age | year | status |
| 125 | 1 | . | . | . |
| 125 | 2 | 15 | 1970 | 0 |
| 125 | 3 | 20 | 1975 | 1 |
| 125 | 4 | . | . | . |
| 125 | 5 | 23 | 1978 | 1 |
| 125 | 6 | . | . | . |
| 125 | 7 | . | . | . |
| 125 | 8 | 28 | 1992 | 2 |
| 125 | 9 | . | . | . |
| 125 | 10 | . | . | . |
| id | state | age | year | status | ||
| 125 | 1 | 15 | 1970 | 0 | ||
| 125 | 2 | 20 | 1975 | 1 | ||
| 125 | 3 | 23 | 1978 |
|
||
| 125 | 4 | 28 | 1992 | 2 | ||
| 125 | 5 | . | . | . | ||
| 125 | 6 | . | . | . | ||
| 125 | 7 | . | . | . | ||
| 125 | 8 | . | . | . | ||
| 125 | 9 | . | . | . | ||
| 125 | 10 | . | . | . |
thankyou in advance
bestregards
nang

Comment