Hello Statalist!

I am fairly new at analyzing data and I am hoping someone will be able to help me understand what is going on with my code and what to do when handling this type of data. I am trying to create 2 variables, one that is full (2) Biological parents and then the other being having at least 1 step/other parent. The "parent1" variable is the parent that is responding to the survey. The "spart" variable is the spouse/partner responding to the survey. This survey collected information from the parents only. This data comes from the Add Health Wave V Parent Data.

With that being said, there are a few sets of parents that are both step-parents to the child, so I need to account for that as well.

Here is how I have coded the parent variables:

*BIO/ADOPTED/STEP/OTHER FOR PARENT1
tab p2wp3b, nolabel
recode p2wp3b (1 2=1) (3=2) (4= 3) (6= 4)(96 97 98=.) , gen (parent1)
lab def parent1 1 "bio/adopted" 2 "step child" 3 "spart child" 4 "other"
tab parent1
tab parent1, m


*BIO/ADOPTED/STEP OTHER FOR SPART
tab p2wp3c
recode p2wp3c (1 2=1) (3=2) (4= 3) (6= 4)(96 97 98=.) , gen (spart)
lab def spart 1 "bio/adopted" 2 "step child" 3 "spart child" 4 "other"
tab spart
tab spart, m


Here is the code I have tried to target the parents that are 100% biological or at least 1 non-biological (I do not think this has worked):

*creating a bio/bio only relationship
gen biorelate=0
replace biorelate=1 if parent1==1 & spart==1

tab biorelate, m

*creating a bio/step only relationship
gen steprelate=0
replace steprelate=1 if parent1== 2 & 3 & 4
replace steprelate=1 if spart== 2 & 3 & 4

if (parent1==2 | parent1==3 | parent1==4 | spart==2 | spart==3 | spart==4)

tab steprelate, m

tab2 biorelate steprelate, m


Here is the output of the tab2 --> note that 0 bio/ 0 step relationship means that these people are 1 step and 1 bio, so this would be categorized as the step relationship that I am trying to get at:


-> tabulation of biorelate by steprelate
| steprelate
biorelate | 0 1 | Total
-----------+----------------------+----------
0 | 1,235 1,233 | 2,468
1 | 1,579 0 | 1,579
-----------+----------------------+----------
Total | 2,814 1,233 | 4,047





I believe that I have to make the step category opposite of the bio-only category but I am not sure if this will work because I have a few people who have 2 step parents... The categories I want in the end are dichotomous: Both Biological Parents and then at least 1 Step-Parent.

I appreciate anyone's help in advance. Thank you.