Thanks as always, Clyde!
-
Login or Register
- Log in with
gen n_siblings = . by hhold (id), sort: egen sibship = total(inlist(relationship, 1, 7)) replace n_siblings = sibship - 1 if inlist(relationship, 1, 7) drop sibship by hhold (id): egen sibship = total(relationship == 3) replace n_siblings = sibship - 1 if relationship == 3 drop sibship by hhold (id): replace n_siblings = 0 if relationship == 6
Comment