Hello, I have a dataset like this,
clear
input str10 id byte (state)
1 1
1 1
1 .
1 .
1 1
1 1
1 1
1 1
1 .
1 0
1 0
1 0
1 0
2 1
2 1
2 1
2 .
2 1
2 1
2 .
2 0
2 0
2 0
2 0
2 0
2 0
3 1
3 1
3 1
3 1
3 1
3 .
3 0
3 .
3 0
3 0
3 0
3 0
3 0
end
I just want to connect the gaps between 1 and 1 or 0 and 0 on the state variable.
As for the gaps between "1" and "0", just leave them alone.
Can someone help me?
Thank you!
clear
input str10 id byte (state)
1 1
1 1
1 .
1 .
1 1
1 1
1 1
1 1
1 .
1 0
1 0
1 0
1 0
2 1
2 1
2 1
2 .
2 1
2 1
2 .
2 0
2 0
2 0
2 0
2 0
2 0
3 1
3 1
3 1
3 1
3 1
3 .
3 0
3 .
3 0
3 0
3 0
3 0
3 0
end
I just want to connect the gaps between 1 and 1 or 0 and 0 on the state variable.
As for the gaps between "1" and "0", just leave them alone.
Can someone help me?
Thank you!
Comment