A common problem when studying families is to identify offspring with affected parents. The problem I can't work my mind around is, how to create a new variable and tell Stata to do the lookup.
In this example here, we have only one pedigree, fam_1, where a person with id 9074 is both a mother as well as affected. This is designated by variable is_affected_mom which gets value 1. The pedigree includes a member with id 9307, whose mother person 9074 is, as indicated with the variable mom_id.
How do I tell Stata to check whether mom_id value can be found both in variable id, and at the same time, to get value 1 in variable is_affected_mom?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str5 family_id long id long mom_id byte is_affected_mom fam_1 9017 . . fam_1 9064 9190 . fam_1 9074 . 1 fam_1 9232 . . fam_1 9233 . . fam_1 9234 . . fam_1 9235 . . fam_1 9307 9074 . fam_1 9386 9190 . end
BR Mikko
0 Response to Identifying persons with affected parents
Post a Comment