Hi all STATA list members,
I have the following problem (which could seem trivial for many of you).
I have a variable expressed in terms of 1 and 0 values:
E.g
ID months_in_occupation months
1 0111100000 4
2 1000001111 5
3 0000111100 4
4 1111111100 8
What I want to create a variable (months) which is the sum of (1) for each individual (ID). Any tips on how to do it?
Thanks in advance,
Rezart
I have the following problem (which could seem trivial for many of you).
I have a variable expressed in terms of 1 and 0 values:
E.g
ID months_in_occupation months
1 0111100000 4
2 1000001111 5
3 0000111100 4
4 1111111100 8
What I want to create a variable (months) which is the sum of (1) for each individual (ID). Any tips on how to do it?
Thanks in advance,
Rezart
Comment