Hi Statalists,
I have encountered a seemingly simple question while managing data with Stata 15.
Basically I want var2 repeatingas long as var1 is the same.
Thanks for any help in advance!
Yingyi
data I have:
data I want:
I have encountered a seemingly simple question while managing data with Stata 15.
Basically I want var2 repeatingas long as var1 is the same.
Thanks for any help in advance!
Yingyi
data I have:
var1 | var2 |
1 | a |
1 | . |
1 | . |
1 | . |
2 | b |
2 | . |
2 | . |
3 | c |
3 | . |
data I want:
var1 | var2 |
1 | a |
1 | a |
1 | a |
1 | a |
2 | b |
2 | b |
2 | b |
3 | c |
3 | c |
Comment