/* NOTE: The following syntax will create new variables that use the old in-law classification scheme. It should be applied only to 2000-2007 ACS and 2005-2007 PRCS IPUMS samples. In addition to RELATE and/or RELATED, your extract should contain YEAR, SAMPLE, SERIAL, AGE, and MARST. It will create a file named old_inlaw.dta with the following new variables: relate_old_inlaw (RELATE with the old in-law classification) related_old_inlaw (RELATED with the old in-law classification) If you do not have both RELATE and RELATED in your file, you will need to delete all lines of the syntax that contain any mention of the variable that your file lacks. */ /* Important: you need to put the do-file in the same directory as your IPUMS data and then set the working directory to that directory. You must also replace "YOUR IPUMS FILE NAME" below with the file name of your IPUMS data (be sure to keep the quotation marks if your file name has spaces in it). */ clear use "YOUR IPUMS FILE NAME.dta" set more off cap drop relate_old_inlaw recode relate (4=14)(6=14)(8=14), copyrest gen(relate_old_inlaw) cap drop related_old_inlaw recode related (401=1401)(601=1401)(801=1401), copyrest gen(related_old_inlaw) by sample serial (relate), sort: gen agediffhd = age - age[1] replace relate_old_inlaw = 8 if relate_old_inlaw==14 & (marst==6 | (agediffhd>=-16 & agediffhd<=10)) replace relate_old_inlaw = 4 if relate_old_inlaw==14 & agediffhd<-16 replace relate_old_inlaw = 6 if relate_old_inlaw==14 & agediffhd>10 replace related_old_inlaw = 801 if related_old_inlaw==1401 & (marst==6 | (agediffhd>=-16 & agediffhd<=10)) replace related_old_inlaw = 401 if related_old_inlaw==1401 & agediffhd<-16 replace related_old_inlaw = 601 if related_old_inlaw==1401 & agediffhd>10 label values relate_old_inlaw relatelbl label values related_old_inlaw relatedlbl drop agediffhd save old_inlaw, replace