I have a dataset like this,
clear
input byte (id state)
1 0
1 .
1 1
2 0
2 0
2 1
3 0
3 .
3 1
4 0
4 .
4 0
4 .
4 1
end
I want to find the position of the "1" within id, which is always in the last place within a person.
I want to use integer to represent the position.
Thank you for your help!
clear
input byte (id state)
1 0
1 .
1 1
2 0
2 0
2 1
3 0
3 .
3 1
4 0
4 .
4 0
4 .
4 1
end
I want to find the position of the "1" within id, which is always in the last place within a person.
I want to use integer to represent the position.
Thank you for your help!

Comment