Create a variable that shows presence of both children and partners in each activity (ATUS)

Hello,

I am trying to create a variable that indicate presence of both children and partners in each activity using ATUS. Using with whom variable (relatew), I created dummy variables for being only with children and only with partners. Should I use activity line number “ACTLINEW” to show whether both children and partners are present in each activity? I tried to check presence of both children and partners by using this command (bysort actlinew: tab childdummy partnerdummy). It seems that there is no activity that has presence of both children and partners. Is that possible? Or should I use “WHOLINE” that shows the number of the who record for each episode?

Thank you!

This was a bit tricky, but I think we’ve been able to figure out how to do what you are describing. Try the following code and see if this creates the sort of dummy variable you want.

* Set-up

replace actline=actlinew if rectype==4

* Create dummy variable for the presence of spouse, partner, or own child

gen famdummy=1 if relatew==200 | relatew==201 | relatew==202

* Count number by each activty per person

bysort caseid actline: egen fam_pres=total(famdummy==1)

* Generate dummy variable indicating the presence of both children and parents

gen fam_pres_dummy = 1 if fam_pres>=2 & rectype==3

This should generate a dummy variable indicating the presence of both children and partners (married and unmarried) for each activity. Let us know if you have any additional questions.

Thank you for this helpful answer! I got the number for presence of both partners and children after using the commands you provided, but it would be great if I could know what “rectype ==3” refers to or what “rectype==4” refers to so that I can understand how the commands generate the number. I looked up IPUMS-ATUS, but there was no detailed description for categories other than it says that it is technical household information. Thank you!

Yeah, the documentation for RECTYPE is lacking. I also noticed this when I was working on this question. RECTYPE==3 is an “activity” record and ==4 is a “who” record.