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


Is there a way that I can convert a DAT file to a STATA file? If so, how is t...
Underlying files for CPS Education Supplements (October)?
Income varialbe values & US variable
Why there is no data for 'VLHALLORG"
.CVS format data uploaded into EXCEL
County Codes
Login   |   Register

Recently Active Members

View More »

Share |