Status:Closed    Asked:Oct 18, 2017 - 10:46 AM

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


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!

Do you have the same question? Follow this Question

Staff Answer


Jeff Bloem


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.


Oct 19, 2017 - 10:32 AM

Report it


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!


Oct 20, 2017 - 03:36 PM

Report it

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.


Oct 23, 2017 - 04:05 PM

Report it


USA IPUMS 1980 ancestry variable -- mapping to country names
Did the version of database change since 2011?
Are DATANUM, SERIAL, and PERNUM the same in single-year and 5-year ACS sample...
How can I accurately calculate the median family income by state for families...
Detailed Variables Dropping From Dataset
Are weights adjusted when using "select cases" in an extraction?
Login   |   Register

Share |