I´m trying to create a new variable. I defined from folioviv, foliohog and parentesco each household, identifyng if the person in the household is the father (parentesco=101), mother (parentesco=201) and children (parentesco=301).
So basically, each household has contained all members, but i need create a new variable complete=1 if the household has father, mother and children, incomplete otherwise, but when I use
by household: gen complete=1 if parentesco==101 & parentesco==201 & parentesco==301 it does not generate any value because the conditions are excludible by row but n by group.
Does anybody know how to create ir? I'm going to let some sample from my base. And thanks so much
folioviv foliohog parentesco household Complete
1 1 101 1
1 1 201 1
1 1 301 1
1 2 101 2
1 2 201 2
2 1 201 3
2 1 301 3
3 1 101 4
3 1 201 4
3 1 301 4
So basically, each household has contained all members, but i need create a new variable complete=1 if the household has father, mother and children, incomplete otherwise, but when I use
by household: gen complete=1 if parentesco==101 & parentesco==201 & parentesco==301 it does not generate any value because the conditions are excludible by row but n by group.
Does anybody know how to create ir? I'm going to let some sample from my base. And thanks so much
folioviv foliohog parentesco household Complete
1 1 101 1
1 1 201 1
1 1 301 1
1 2 101 2
1 2 201 2
2 1 201 3
2 1 301 3
3 1 101 4
3 1 201 4
3 1 301 4

Comment