/* NOTE: The following syntax will create new variables that use the old in-law classification scheme. It should be applied only to ACS and PRCS IPUMS samples. In addition to RELATE and/or RELATED, your extract should contain YEAR, SAMPLE, SERIAL, AGE, and MARST. It will create a new file named old_inlaw.sas7bdat 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 do-file that contain any mention of the variable that your file lacks. */ /* Important: you need to put this syntax file in the same directory as your IPUMS data and then replace 'YOUR DIRECTORY' below with the name of that directory (be sure to keep the single quotation marks). You must also replace 'YOUR IPUMS PATH AND FILE NAME' in the PROC SORT command below with the full path and name of your IPUMS file. */ libname ipumsdat 'YOUR DIRECTORY'; proc sort data=ipumsdat.YOUR IPUMS FILE NAME out=temporig; by sample serial; proc format cntlout=ipumsdat.fusa_old_inlaw; value relate_f 01="Head/Householder" 02="Spouse" 03="Child" 04="Child-in-law" 05="Parent" 06="Parent-in-Law" 07="Sibling" 08="Sibling-in-Law" 09="Grandchild" 10="Other relatives" 11="Partner, friend, visitor" 12="Other non-relatives" 13="Institutional inmates" ; value related_f 0101="Head/Householder" 0201="Spouse" 0202="2nd/3rd Wife (Polygamous)" 0301="Child" 0302="Adopted Child" 0303="Stepchild" 0304="Adopted, n.s." 0401="Child-in-law" 0402="Step Child-in-law" 0501="Parent" 0502="Stepparent" 0601="Parent-in-Law" 0602="Stepparent-in-law" 0701="Sibling" 0702="Step/Half/Adopted Sibling" 0801="Sibling-in-Law" 0802="Step/Half Sibling-in-law" 0901="Grandchild" 0902="Adopted Grandchild" 0903="Step Grandchild" 0904="Grandchild-in-law" 1000="Other Relatives:" 1001="Other Relatives" 1011="Grandparent" 1012="Step Grandparent" 1013="Grandparent-in-law" 1021="Aunt or Uncle" 1022="Aunt,Uncle-in-law" 1031="Nephew, Niece" 1032="Neph/Niece-in-law" 1033="Step/Adopted Nephew/Niece" 1034="Grand Niece/Nephew" 1041="Cousin" 1042="Cousin-in-law" 1051="Great Grandchild" 1061="Other relatives, nec" 1100="Partner, Friend, Visitor" 1110="Partner/friend" 1111="Friend" 1112="Partner" 1113="Partner/roommate" 1114="Unmarried Partner" 1115="Housemate/Roomate" 1120="Relative of partner" 1130="Concubine/Mistress" 1131="Visitor" 1132="Companion and family of companion" 1139="Allocated partner/friend/visitor" 1200="Other non-relatives" 1201="Roomers/boarders/lodgers" 1202="Boarders" 1203="Lodgers" 1204="Roomer" 1205="Tenant" 1206="Foster child" 1210="Employees:" 1211="Servant" 1212="Housekeeper" 1213="Maid" 1214="Cook" 1215="Nurse" 1216="Other probable domestic employee" 1217="Other employee" 1219="Relative of employee" 1221="Military" 1222="Students" 1223="Members of religious orders" 1230="Other non-relatives" 1239="Allocated other non-relative" 1240="Roomers/boarders/lodgers and foster children" 1241="Roomers/boarders/lodgers" 1242="Foster children" 1250="Employees" 1251="Domestic employees" 1252="Non-domestic employees" 1253="Relative of employee" 1260="Other non-relatives (1990 includes employees)" 1270="Non-inmate 1990" 1281="Head of group quarters" 1282="Employees of group quarters" 1283="Relative of head, staff, or employee group quarters" 1284="Other non-inmate 1940-1959" 1291="Military" 1292="College dormitories" 1293="Residents of rooming houses" 1294="Other non-inmate 1980 (includes employees and non-inmates in" 1295="Other non-inmates 1960-1970 (includes employees)" 1296="Non-inmates in institutions" 1301="Institutional inmates" ; run; data agehd; set temporig; keep sample serial relate related age; if (relate=1 | related=101); rename age=agehd; drop relate related; proc sort data=agehd; by sample serial; data ipumsdat.old_inlaw; merge temporig agehd; by sample serial; relate_old_inlaw = relate; if (relate=4 | relate=6 | relate=8) then relate_old_inlaw=14; related_old_inlaw = related; if (related=401 | related=601 | related=801) then related_old_inlaw=1401; agediffhd = age - agehd; if (relate_old_inlaw=14 & (marst=6 | (agediffhd>=-16 & agediffhd<=10))) then relate_old_inlaw=8; if (relate_old_inlaw=14 & agediffhd<-16) then relate_old_inlaw=4; if (relate_old_inlaw=14 & agediffhd>10) then relate_old_inlaw=6; if (related_old_inlaw=1401 & (marst=6 | (agediffhd>=-16 & agediffhd<=10))) then related_old_inlaw=801; if (related_old_inlaw=1401 & agediffhd<-16) then related_old_inlaw=401; if (related_old_inlaw=1401 & agediffhd>10) then related_old_inlaw=601; drop agehd agediffhd; run; format relate_old_inlaw relate_f. related_old_inlaw related_f. ; run;