************************************************************************** * JUNE 19, 2008 * * SAS PROGRAM FOR CREATING NHIS RECODES PERTAINING TO "TIME SINCE CANCER * SCREENING TEST" FOR 2005 DATA * * Background: * The Cancer Screening section (NAF) of the 2005 Cancer Control Module * collected information about selected cancer screening tests received by the sample * adult, including skin exams, Pap smear tests, mammograms, clinical breast exams, * prostate specific antigen (PSA) tests, colorectal screening exams, and fecal occult * blood (FOB) tests (performed in a doctor's office and at home. Cancer screening test * refers to tests or exams used to detect or screen for cancer. * In 2005 the skip pattern was changed in the cancer screening test * section (NAF) so that any respondent giving an incomplete or partial * date of screening test (year but not month) was led to answer the time category * (time interval since screening test) question (RPAP2CA etc). Due to this change * there is no need for imputation of month as was needed for the 2000 and 2003 NHIS data. * * 2005 cancer screening test recodes: * The "A" variables (RMam3A, RPap3A, etc.) use all available information, * pre-filling the cancer screening test recode with the response to the time category * question first, if available. Because these data are provided by the respondent (and are * therefore not imputed), this method is recommended by NHIS. The National Cancer * Institute and the Office of Analysis and Epidemiology, National Center for Health * Statistics are using this method for the 2005 NHIS data. * * Cancer screening test recodes for trend estimates using a common methodology: * The "B" variables (RMam3B, RPap3B, etc.) are provided for analysts who * wish to study trends over time and prefer to use a common method to estimate * time of cancer screening tests in 2000-2005. The "B" variable SAS code uses the same * information collected in 2000 and 2003, and the same estimation method used in 2000. * It is consistent with the methods used in 2000 and 2003 by the National Cancer Institute * and the Office of Analysis and Epidemiology, National Center for Health Statistics. * The following examples illustrate the "B" variables (RMam3B, RPap3B, etc.) * methods: * - If a person reported a cancer screening test "1 year ago", the test is counted as 12 * months ago. If a person reported a cancer screening test "2 years ago", the test is * counted as 24 months ago, etc. * - If a person reported the year of the cancer screening test but not the month, the test * is assigned to July of that year. Day of cancer screening test is set to 15 for * respondents with month and year, or year only. * NOTE ON 'NOT ASCERTAINED': * - For the small number of responses where the date of the cancer screening test was later * than the interview date, the time category recode is set to 'not ascertained'. * - Where the only information is '95 or more time units (days, weeks, or months) ago', * there is no way to specify the time category in which the respondent belongs, and * the recode is also set to 'not ascertained'(i.e., if it was 95-104 weeks, it would fall * in the "More than 1 year but not more than 2 years ago" category, if it was * 105-156 weeks, it would fall in the "More than 2 years but not more * than 3 years ago" category, etc.) ******************************************************************************** ; /*SET OPTIONS FOR PAGE FORMAT AS DESIRED*/ OPTIONS PAGENO=1 PS=54 LS=96 SOURCE NOCENTER DATE NOFMTERR FMTSEARCH=(LIBRARY); /*SET UP LIBNAMES AND FILEREFS*/ /*HAVE READY NHIS FAMILY (Familyxx) AND CANCER (Cancerxx) SAS DATASETS*/ /*USE NHIS SAS PROGRAMS TO CREATE FILES AND FORMATS*/ /*USER NOTE: MODIFY SET UP OF LIBNAMES AND FILEREFS AS NEEDED*/ LIBNAME NHIS 'C:\NHIS2005\'; LIBNAME LIBRARY 'C:\NHIS2005\'; **SORT FILES BY HOUSEHOLD AND FAMILY IDENTIFIER; proc sort data=NHIS.cancerxx out=CAN2005; by hhx fmx; run; proc sort data=NHIS.familyxx out=FAM2005; by hhx fmx; run; **MERGE CANCER AND FAMILY KEEPING INTERVIEW MONTH AND YEAR FROM FAMILY; data nhis2005; merge can2005(in=F_CAN) fam2005(in=F_FAM keep=hhx fmx fint_m_p fint_y_p); by hhx fmx; if F_CAN; **SET INTERVIEW DAY to 15th of INTERVIEW MONTH; label intdate = 'Interview date (set to 15th of the month)'; intdate = mdy(fint_m_p, 15, fint_y_p); format intdate mmddyy10.; **PART 1; ***CREATE CANCER SCREEN VARIABLES WITH FIVE(5) TIME CATEGORIES; ***MAMMOGRAM, PAP SMEAR, PROSTATE-SPECIFIC ANTIGEN TEST; label RMam3A = 'Most recent mammogram, time categories' RMam3B = 'Most recent mammogram, time categories (using 2000/2003 methods)' RPap3A = 'Most recent Pap test, time categories' RPap3B = 'Most recent Pap test, time categories (using 2000/2003 methods)' RPSA3A = 'Most recent PSA test, time categories' RPSA3B = 'Most recent PSA test, time categories (using 2000/2003 methods)' ; array a_testamt[*] rmam1_mt rpap1_mt rpsa1_mt ; array a_testayr[*] rmam1_yr rpap1_yr rpsa1_yr ; array a_testadate[*] mamdate papdate psadate ; array a_testamosago[*] mammosago papmosago psamosago; array a_testahad[*] mamhad paphad psahad ; array a_testatp[*] rmam1t rpap1t rpsa1t ; array a_testano[*] rmam1n rpap1n rpsa1n ; array a_testa2[*] rmam2ca rpap2ca rpsa2 ; array a_testa3a[*] rmam3a rpap3a rpsa3a ; array a_testa3b[*] rmam3b rpap3b rpsa3b ; **CALCULATING VERSION "B" CANCER SCREEN RECODES USING 2000, 2003 METHOD; do i = 1 to dim(a_testa3b); **IF TEST YEAR IS VALID; if .12 and a_testayr[i]=fint_y_p then a_testamosago[i]=0; else put 'Invalid test/interview date - five time catagories. ' HHX= fmx= fpx= a_testayr[i]= a_testamt[i]= fint_y_p= fint_m_p=; end; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "A" USING ALL AVAILABLE DATA; if a_testahad[i] ne 1 then a_testa3a[i]=.; **FILL WITH TIME CATEGORY FIRST; else if a_testa2[i]>0 then a_testa3a[i]=a_testa2[i]; **MONTHS; else if 0<=a_testamosago[i]<=12 then a_testa3a[i]=1; else if 13<=a_testamosago[i]<=24 then a_testa3a[i]=2; else if 25<=a_testamosago[i]<=36 then a_testa3a[i]=3; else if 37<=a_testamosago[i]<=60 then a_testa3a[i]=4; else if 61<=a_testamosago[i] then a_testa3a[i]=5; **TIME UNIT AND NUMBER; else if a_testatp[i]=1 and 1<=a_testano[i]<=94 then a_testa3a[i]=1; else if a_testatp[i]=2 and 1<=a_testano[i]<=52 then a_testa3a[i]=1; else if a_testatp[i]=2 and 53<=a_testano[i]<=94 then a_testa3a[i]=2; else if a_testatp[i]=3 and 1<=a_testano[i]<=12 then a_testa3a[i]=1; else if a_testatp[i]=3 and 13<=a_testano[i]<=24 then a_testa3a[i]=2; else if a_testatp[i]=3 and 25<=a_testano[i]<=36 then a_testa3a[i]=3; else if a_testatp[i]=3 and 37<=a_testano[i]<=60 then a_testa3a[i]=4; else if a_testatp[i]=3 and 61<=a_testano[i]<=95 then a_testa3a[i]=5; else if a_testatp[i]=4 and a_testano[i] = 1 then a_testa3a[i]=1; else if a_testatp[i]=4 and a_testano[i] = 2 then a_testa3a[i]=2; else if a_testatp[i]=4 and a_testano[i] = 3 then a_testa3a[i]=3; else if a_testatp[i]=4 and 4<=a_testano[i]<= 5 then a_testa3a[i]=4; else if a_testatp[i]=4 and 6<=a_testano[i]<=95 then a_testa3a[i]=5; else a_testa3a[i]=8; ***Not ascertained; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "B" USING 2000,2003 METHOD; if a_testahad[i] ne 1 then a_testa3b[i]=.; **MONTHS; else if 0<=a_testamosago[i]<=12 then a_testa3b[i]=1; else if 13<=a_testamosago[i]<=24 then a_testa3b[i]=2; else if 25<=a_testamosago[i]<=36 then a_testa3b[i]=3; else if 37<=a_testamosago[i]<=60 then a_testa3b[i]=4; else if 61<=a_testamosago[i] then a_testa3b[i]=5; **TIME UNIT AND NUMBER; else if a_testatp[i]=1 and 1<=a_testano[i]<=94 then a_testa3b[i]=1; else if a_testatp[i]=2 and 1<=a_testano[i]<=52 then a_testa3b[i]=1; else if a_testatp[i]=2 and 53<=a_testano[i]<=94 then a_testa3b[i]=2; else if a_testatp[i]=3 and 1<=a_testano[i]<=12 then a_testa3b[i]=1; else if a_testatp[i]=3 and 13<=a_testano[i]<=24 then a_testa3b[i]=2; else if a_testatp[i]=3 and 25<=a_testano[i]<=36 then a_testa3b[i]=3; else if a_testatp[i]=3 and 37<=a_testano[i]<=60 then a_testa3b[i]=4; else if a_testatp[i]=3 and 61<=a_testano[i]<=95 then a_testa3b[i]=5; else if a_testatp[i]=4 and a_testano[i] = 1 then a_testa3b[i]=1; else if a_testatp[i]=4 and a_testano[i] = 2 then a_testa3b[i]=2; else if a_testatp[i]=4 and a_testano[i] = 3 then a_testa3b[i]=3; else if a_testatp[i]=4 and 4<=a_testano[i]<= 5 then a_testa3b[i]=4; else if a_testatp[i]=4 and 6<=a_testano[i]<=95 then a_testa3b[i]=5; else if a_testa2[i]>0 then a_testa3b[i]=a_testa2[i]; else a_testa3b[i]=8; ***Not ascertained; end; ***PART 2; ***CREATE CANCER SCREEN RECODES WITH SIX(6) TIME CATEGORIES; ***COLORECTAL EXAM, HOME FECAL OCCULT BLOOD TEST, OFFICE BLOOD STOOL TEST; label RCRE3A = 'Most recent colorectal endoscopy, time categories' RCRE3B = 'Most recent colorectal endoscopy, time categories (using 2000/2003 methods)' RHFOB3A = 'Most recent home blood stool test, time categories' RHFOB3B = 'Most recent home blood stool test, time categories (using 2000/2003 methods)' ROFOB3A = 'Most recent office blood stool test, time categories' ROFOB3B = 'Most recent office blood stool test, time categories (using 2000/2003 methods)' ; array a_testbmt[*] rcre1_mt rhfo1_mt rfob1_mt ; array a_testbyr[*] rcre1_yr rhfo1_yr rfob1_yr ; array a_testbdate[*] credate hfobdate ofobdate ; array a_testbmosago[*] cremosago hfobmosago ofobmosago; array a_testbhad[*] crehad hfobhad fobhad ; array a_testbtp[*] rcre1t rhfo1t rfob1t ; array a_testbno[*] rcre1n rhfo1n rfob1n ; array a_testb2[*] rcre2 rhfo2 rfob2 ; array a_testb3a[*] rcre3a rhfob3a rofob3a ; array a_testb3b[*] rcre3b rhfob3b rofob3b ; **CALCULATING VERSION "B" CANCER SCREEN RECODES USING 2000, 2003 METHOD; do i = 1 to dim(a_testb3b); **IF TEST YEAR IS VALID; if . < a_testbyr[i]<9996 then do; **IF TEST MONTH IS VALID, SET TEST DAY TO 15th; if 1<=a_testbmt[i]<=12 then a_testbdate[i] = mdy(a_testbmt[i], 15, a_testbyr[i]); **ELSE SET TEST MONTH TO JULY AND TEST DAY TO 15th; else a_testbdate[i] = mdy(7, 15, a_testbyr[i]); end; else a_testbdate[i]=.; **CALCULATE TIME SINCE TEST; a_testbmosago[i] = intck('month', a_testbdate[i], intdate); if . < a_testbmosago[i]<0 then do; **IF TEST MONTH NOT GIVEN BUT TEST YEAR SAME AS INTERVIEW YEAR; if a_testbmt[i]>12 and a_testbyr[i]=fint_y_p then a_testbmosago[i]=0; else put 'Invalid test/interview date - six time catagories. ' hhx = fmx= fpx= a_testbyr[i]= a_testbmt[i]= fint_y_p= fint_m_p=; end; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "A" USING ALL AVAILABLE DATA; if a_testbhad[i] ne 1 then a_testb3a[i]=.; **FILL WITH TIME CATEGORY FIRST; else if a_testb2[i]>0 then a_testb3a[i]=a_testb2[i]; **MONTHS; else if 0<=a_testbmosago[i]<=12 then a_testb3a[i]=1; else if 13<=a_testbmosago[i]<=24 then a_testb3a[i]=2; else if 25<=a_testbmosago[i]<=36 then a_testb3a[i]=3; else if 37<=a_testbmosago[i]<=60 then a_testb3a[i]=4; else if 61<=a_testbmosago[i]<=120 then a_testb3a[i]=5; else if 121<=a_testbmosago[i] then a_testb3a[i]=6; **TIME UNIT AND NUMBER; else if a_testbtp[i]=1 and 1<=a_testbno[i]<=94 then a_testb3a[i]=1; else if a_testbtp[i]=2 and 1<=a_testbno[i]<=52 then a_testb3a[i]=1; else if a_testbtp[i]=2 and 53<=a_testbno[i]<=94 then a_testb3a[i]=2; else if a_testbtp[i]=3 and 1<=a_testbno[i]<=12 then a_testb3a[i]=1; else if a_testbtp[i]=3 and 13<=a_testbno[i]<=24 then a_testb3a[i]=2; else if a_testbtp[i]=3 and 25<=a_testbno[i]<=36 then a_testb3a[i]=3; else if a_testbtp[i]=3 and 37<=a_testbno[i]<=60 then a_testb3a[i]=4; else if a_testbtp[i]=3 and 61<=a_testbno[i]<=94 then a_testb3a[i]=5; else if a_testbtp[i]=4 and a_testbno[i] = 1 then a_testb3a[i]=1; else if a_testbtp[i]=4 and a_testbno[i] = 2 then a_testb3a[i]=2; else if a_testbtp[i]=4 and a_testbno[i] = 3 then a_testb3a[i]=3; else if a_testbtp[i]=4 and 4<=a_testbno[i]<= 5 then a_testb3a[i]=4; else if a_testbtp[i]=4 and 6<=a_testbno[i]<=10 then a_testb3a[i]=5; else if a_testbtp[i]=4 and 11<=a_testbno[i]<=95 then a_testb3a[i]=6; else a_testb3a[i]=8; ***Not ascertained; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "B" USING 2000,2003 METHOD; if a_testbhad[i] ne 1 then a_testb3b[i]=.; **MONTHS; else if 0<=a_testbmosago[i]<=12 then a_testb3b[i]=1; else if 13<=a_testbmosago[i]<=24 then a_testb3b[i]=2; else if 25<=a_testbmosago[i]<=36 then a_testb3b[i]=3; else if 37<=a_testbmosago[i]<=60 then a_testb3b[i]=4; else if 61<=a_testbmosago[i]<=120 then a_testb3b[i]=5; else if 121<=a_testbmosago[i] then a_testb3b[i]=6; **TIME UNIT AND NUMBER; else if a_testbtp[i]=1 and 1<=a_testbno[i]<=94 then a_testb3b[i]=1; else if a_testbtp[i]=2 and 1<=a_testbno[i]<=52 then a_testb3b[i]=1; else if a_testbtp[i]=2 and 53<=a_testbno[i]<=94 then a_testb3b[i]=2; else if a_testbtp[i]=3 and 1<=a_testbno[i]<=12 then a_testb3b[i]=1; else if a_testbtp[i]=3 and 13<=a_testbno[i]<=24 then a_testb3b[i]=2; else if a_testbtp[i]=3 and 25<=a_testbno[i]<=36 then a_testb3b[i]=3; else if a_testbtp[i]=3 and 37<=a_testbno[i]<=60 then a_testb3b[i]=4; else if a_testbtp[i]=3 and 61<=a_testbno[i]<=94 then a_testb3b[i]=5; else if a_testbtp[i]=4 and a_testbno[i] = 1 then a_testb3b[i]=1; else if a_testbtp[i]=4 and a_testbno[i] = 2 then a_testb3b[i]=2; else if a_testbtp[i]=4 and a_testbno[i] = 3 then a_testb3b[i]=3; else if a_testbtp[i]=4 and 4<=a_testbno[i]<= 5 then a_testb3b[i]=4; else if a_testbtp[i]=4 and 6<=a_testbno[i]<=10 then a_testb3b[i]=5; else if a_testbtp[i]=4 and 11<=a_testbno[i]<=95 then a_testb3b[i]=6; else if a_testb2[i]>0 then a_testb3b[i]=a_testb2[i]; else a_testb3b[i]=8; ***Not ascertained; end; run; ***create permanent NHIS 2005 cancer recode (NAF section) dataset; data nhis.NAF2005; set nhis2005; ***Apply existing formats from the cancerxx file to the new variables; format rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b cap253x. rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b cap177x. ; ***Keep the new variables and ID variables; keep hhx fmx fpx rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b; run; proc contents data=nhis.NAF2005; run; PROC freq; tables rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b; title 'NHIS NAF 2005 Cancer time category recodes freqs'; title2 'Recodes "A" use all available data, Recodes "B" use 2000/2003 method'; run; ************************************************************************** * JUNE 19, 2008 * * SAS PROGRAM FOR CREATING NHIS RECODES PERTAINING TO "TIME SINCE CANCER * SCREENING TEST" FOR 2005 DATA * * Background: * The Cancer Screening section (NAF) of the 2005 Cancer Control Module * collected information about selected cancer screening tests received by the sample * adult, including skin exams, Pap smear tests, mammograms, clinical breast exams, * prostate specific antigen (PSA) tests, colorectal screening exams, and fecal occult * blood (FOB) tests (performed in a doctor's office and at home. Cancer screening test * refers to tests or exams used to detect or screen for cancer. * In 2005 the skip pattern was changed in the cancer screening test * section (NAF) so that any respondent giving an incomplete or partial * date of screening test (year but not month) was led to answer the time category * (time interval since screening test) question (RPAP2CA etc). Due to this change * there is no need for imputation of month as was needed for the 2000 and 2003 NHIS data. * * 2005 cancer screening test recodes: * The "A" variables (RMam3A, RPap3A, etc.) use all available information, * pre-filling the cancer screening test recode with the response to the time category * question first, if available. Because these data are provided by the respondent (and are * therefore not imputed), this method is recommended by NHIS. The National Cancer * Institute and the Office of Analysis and Epidemiology, National Center for Health * Statistics are using this method for the 2005 data. * * Cancer screening test recodes for trend estimates using a common methodology: * The "B" variables (RMam3B, RPap3B, etc.) are provided for analysts who * wish to study trends over time and prefer to use a common method to estimate * time of cancer screening tests in 2000-2005. The "B" variable SAS code uses the same * information collected in 2000 and 2003, and the same estimation method used in 2000. * It is consistent with the methods used in 2000 and 2003 by the National Cancer Institute * and the Office of Analysis and Epidemiology, National Center for Health Statistics. * The following examples illustrate the "B" variables (RMam3B, RPap3B, etc.) * methods: * - If a person reported a cancer screening test "1 year ago", the test is counted as 12 * months ago. If a person reported a cancer screening test "2 years ago", the test is * counted as 24 months ago, etc. * - If a person reported the year of the cancer screening test but not the month, the test * is assigned to July of that year. Day of cancer screening test is set to 15 for * respondents with month and year, or year only. * NOTE ON 'NOT ASCERTAINED': * - For the small number of responses where the date of the cancer screening test was later * than the interview date, the time category recode is set to 'not ascertained'. * - Where the only information is '95 or more time units (days, weeks, or months) ago', * there is no way to specify the time category in which the respondent belongs, and * the recode is also set to 'not ascertained'(i.e., if it was 95-104 weeks, it would fall * in the "More than 1 year but not more than 2 years ago" category, if it was * 105-156 weeks, it would fall in the "More than 2 years but not more * than 3 years ago" category, etc.) ******************************************************************************** ; /*SET OPTIONS FOR PAGE FORMAT AS DESIRED*/ OPTIONS PAGENO=1 PS=54 LS=96 SOURCE NOCENTER DATE NOFMTERR FMTSEARCH=(LIBRARY); /*SET UP LIBNAMES AND FILEREFS*/ /*HAVE READY NHIS FAMILY (Familyxx) AND CANCER (Cancerxx) SAS DATASETS*/ /*USE NHIS SAS PROGRAMS TO CREATE FILES AND FORMATS*/ /*USER NOTE: MODIFY SET UP OF LIBNAMES AND FILEREFS AS NEEDED*/ LIBNAME NHIS 'C:\NHIS2005\'; LIBNAME LIBRARY 'C:\NHIS2005\'; **SORT FILES BY HOUSEHOLD AND FAMILY IDENTIFIER; proc sort data=NHIS.cancerxx out=CAN2005; by hhx fmx; run; proc sort data=NHIS.familyxx out=FAM2005; by hhx fmx; run; **MERGE CANCER AND FAMILY KEEPING INTERVIEW MONTH AND YEAR FROM FAMILY; data nhis2005; merge can2005(in=F_CAN) fam2005(in=F_FAM keep=hhx fmx fint_m_p fint_y_p); by hhx fmx; if F_CAN; **SET INTERVIEW DAY to 15th of INTERVIEW MONTH; label intdate = 'Interview date (set to 15th of the month)'; intdate = mdy(fint_m_p, 15, fint_y_p); format intdate mmddyy10.; **PART 1; ***CREATE CANCER SCREEN VARIABLES WITH FIVE(5) TIME CATEGORIES; ***MAMMOGRAM, PAP SMEAR, PROSTATE-SPECIFIC ANTIGEN TEST; label RMam3A = 'Most recent mammogram, time categories' RMam3B = 'Most recent mammogram, time categories (using 2000/2003 methods)' RPap3A = 'Most recent Pap test, time categories' RPap3B = 'Most recent Pap test, time categories (using 2000/2003 methods)' RPSA3A = 'Most recent PSA test, time categories' RPSA3B = 'Most recent PSA test, time categories (using 2000/2003 methods)' ; array a_testamt[*] rmam1_mt rpap1_mt rpsa1_mt ; array a_testayr[*] rmam1_yr rpap1_yr rpsa1_yr ; array a_testadate[*] mamdate papdate psadate ; array a_testamosago[*] mammosago papmosago psamosago; array a_testahad[*] mamhad paphad psahad ; array a_testatp[*] rmam1t rpap1t rpsa1t ; array a_testano[*] rmam1n rpap1n rpsa1n ; array a_testa2[*] rmam2ca rpap2ca rpsa2 ; array a_testa3a[*] rmam3a rpap3a rpsa3a ; array a_testa3b[*] rmam3b rpap3b rpsa3b ; **CALCULATING VERSION "B" CANCER SCREEN RECODES USING 2000, 2003 METHOD; do i = 1 to dim(a_testa3b); **IF TEST YEAR IS VALID; if .12 and a_testayr[i]=fint_y_p then a_testamosago[i]=0; else put 'Invalid test/interview date - five time catagories. ' HHX= fmx= fpx= a_testayr[i]= a_testamt[i]= fint_y_p= fint_m_p=; end; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "A" USING ALL AVAILABLE DATA; if a_testahad[i] ne 1 then a_testa3a[i]=.; **FILL WITH TIME CATEGORY FIRST; else if a_testa2[i]>0 then a_testa3a[i]=a_testa2[i]; **MONTHS; else if 0<=a_testamosago[i]<=12 then a_testa3a[i]=1; else if 13<=a_testamosago[i]<=24 then a_testa3a[i]=2; else if 25<=a_testamosago[i]<=36 then a_testa3a[i]=3; else if 37<=a_testamosago[i]<=60 then a_testa3a[i]=4; else if 61<=a_testamosago[i] then a_testa3a[i]=5; **TIME UNIT AND NUMBER; else if a_testatp[i]=1 and 1<=a_testano[i]<=94 then a_testa3a[i]=1; else if a_testatp[i]=2 and 1<=a_testano[i]<=52 then a_testa3a[i]=1; else if a_testatp[i]=2 and 53<=a_testano[i]<=94 then a_testa3a[i]=2; else if a_testatp[i]=3 and 1<=a_testano[i]<=12 then a_testa3a[i]=1; else if a_testatp[i]=3 and 13<=a_testano[i]<=24 then a_testa3a[i]=2; else if a_testatp[i]=3 and 25<=a_testano[i]<=36 then a_testa3a[i]=3; else if a_testatp[i]=3 and 37<=a_testano[i]<=60 then a_testa3a[i]=4; else if a_testatp[i]=3 and 61<=a_testano[i]<=95 then a_testa3a[i]=5; else if a_testatp[i]=4 and a_testano[i] = 1 then a_testa3a[i]=1; else if a_testatp[i]=4 and a_testano[i] = 2 then a_testa3a[i]=2; else if a_testatp[i]=4 and a_testano[i] = 3 then a_testa3a[i]=3; else if a_testatp[i]=4 and 4<=a_testano[i]<= 5 then a_testa3a[i]=4; else if a_testatp[i]=4 and 6<=a_testano[i]<=95 then a_testa3a[i]=5; else a_testa3a[i]=8; ***Not ascertained; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "B" USING 2000,2003 METHOD; if a_testahad[i] ne 1 then a_testa3b[i]=.; **MONTHS; else if 0<=a_testamosago[i]<=12 then a_testa3b[i]=1; else if 13<=a_testamosago[i]<=24 then a_testa3b[i]=2; else if 25<=a_testamosago[i]<=36 then a_testa3b[i]=3; else if 37<=a_testamosago[i]<=60 then a_testa3b[i]=4; else if 61<=a_testamosago[i] then a_testa3b[i]=5; **TIME UNIT AND NUMBER; else if a_testatp[i]=1 and 1<=a_testano[i]<=94 then a_testa3b[i]=1; else if a_testatp[i]=2 and 1<=a_testano[i]<=52 then a_testa3b[i]=1; else if a_testatp[i]=2 and 53<=a_testano[i]<=94 then a_testa3b[i]=2; else if a_testatp[i]=3 and 1<=a_testano[i]<=12 then a_testa3b[i]=1; else if a_testatp[i]=3 and 13<=a_testano[i]<=24 then a_testa3b[i]=2; else if a_testatp[i]=3 and 25<=a_testano[i]<=36 then a_testa3b[i]=3; else if a_testatp[i]=3 and 37<=a_testano[i]<=60 then a_testa3b[i]=4; else if a_testatp[i]=3 and 61<=a_testano[i]<=95 then a_testa3b[i]=5; else if a_testatp[i]=4 and a_testano[i] = 1 then a_testa3b[i]=1; else if a_testatp[i]=4 and a_testano[i] = 2 then a_testa3b[i]=2; else if a_testatp[i]=4 and a_testano[i] = 3 then a_testa3b[i]=3; else if a_testatp[i]=4 and 4<=a_testano[i]<= 5 then a_testa3b[i]=4; else if a_testatp[i]=4 and 6<=a_testano[i]<=95 then a_testa3b[i]=5; else if a_testa2[i]>0 then a_testa3b[i]=a_testa2[i]; else a_testa3b[i]=8; ***Not ascertained; end; ***PART 2; ***CREATE CANCER SCREEN RECODES WITH SIX(6) TIME CATEGORIES; ***COLORECTAL EXAM, HOME FECAL OCCULT BLOOD TEST, OFFICE BLOOD STOOL TEST; label RCRE3A = 'Most recent colorectal endoscopy, time categories' RCRE3B = 'Most recent colorectal endoscopy, time categories (using 2000/2003 methods)' RHFOB3A = 'Most recent home blood stool test, time categories' RHFOB3B = 'Most recent home blood stool test, time categories (using 2000/2003 methods)' ROFOB3A = 'Most recent office blood stool test, time categories' ROFOB3B = 'Most recent office blood stool test, time categories (using 2000/2003 methods)' ; array a_testbmt[*] rcre1_mt rhfo1_mt rfob1_mt ; array a_testbyr[*] rcre1_yr rhfo1_yr rfob1_yr ; array a_testbdate[*] credate hfobdate ofobdate ; array a_testbmosago[*] cremosago hfobmosago ofobmosago; array a_testbhad[*] crehad hfobhad fobhad ; array a_testbtp[*] rcre1t rhfo1t rfob1t ; array a_testbno[*] rcre1n rhfo1n rfob1n ; array a_testb2[*] rcre2 rhfo2 rfob2 ; array a_testb3a[*] rcre3a rhfob3a rofob3a ; array a_testb3b[*] rcre3b rhfob3b rofob3b ; **CALCULATING VERSION "B" CANCER SCREEN RECODES USING 2000, 2003 METHOD; do i = 1 to dim(a_testb3b); **IF TEST YEAR IS VALID; if . < a_testbyr[i]<9996 then do; **IF TEST MONTH IS VALID, SET TEST DAY TO 15th; if 1<=a_testbmt[i]<=12 then a_testbdate[i] = mdy(a_testbmt[i], 15, a_testbyr[i]); **ELSE SET TEST MONTH TO JULY AND TEST DAY TO 15th; else a_testbdate[i] = mdy(7, 15, a_testbyr[i]); end; else a_testbdate[i]=.; **CALCULATE TIME SINCE TEST; a_testbmosago[i] = intck('month', a_testbdate[i], intdate); if . < a_testbmosago[i]<0 then do; **IF TEST MONTH NOT GIVEN BUT TEST YEAR SAME AS INTERVIEW YEAR; if a_testbmt[i]>12 and a_testbyr[i]=fint_y_p then a_testbmosago[i]=0; else put 'Invalid test/interview date - six time catagories. ' hhx = fmx= fpx= a_testbyr[i]= a_testbmt[i]= fint_y_p= fint_m_p=; end; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "A" USING ALL AVAILABLE DATA; if a_testbhad[i] ne 1 then a_testb3a[i]=.; **FILL WITH TIME CATEGORY FIRST; else if a_testb2[i]>0 then a_testb3a[i]=a_testb2[i]; **MONTHS; else if 0<=a_testbmosago[i]<=12 then a_testb3a[i]=1; else if 13<=a_testbmosago[i]<=24 then a_testb3a[i]=2; else if 25<=a_testbmosago[i]<=36 then a_testb3a[i]=3; else if 37<=a_testbmosago[i]<=60 then a_testb3a[i]=4; else if 61<=a_testbmosago[i]<=120 then a_testb3a[i]=5; else if 121<=a_testbmosago[i] then a_testb3a[i]=6; **TIME UNIT AND NUMBER; else if a_testbtp[i]=1 and 1<=a_testbno[i]<=94 then a_testb3a[i]=1; else if a_testbtp[i]=2 and 1<=a_testbno[i]<=52 then a_testb3a[i]=1; else if a_testbtp[i]=2 and 53<=a_testbno[i]<=94 then a_testb3a[i]=2; else if a_testbtp[i]=3 and 1<=a_testbno[i]<=12 then a_testb3a[i]=1; else if a_testbtp[i]=3 and 13<=a_testbno[i]<=24 then a_testb3a[i]=2; else if a_testbtp[i]=3 and 25<=a_testbno[i]<=36 then a_testb3a[i]=3; else if a_testbtp[i]=3 and 37<=a_testbno[i]<=60 then a_testb3a[i]=4; else if a_testbtp[i]=3 and 61<=a_testbno[i]<=94 then a_testb3a[i]=5; else if a_testbtp[i]=4 and a_testbno[i] = 1 then a_testb3a[i]=1; else if a_testbtp[i]=4 and a_testbno[i] = 2 then a_testb3a[i]=2; else if a_testbtp[i]=4 and a_testbno[i] = 3 then a_testb3a[i]=3; else if a_testbtp[i]=4 and 4<=a_testbno[i]<= 5 then a_testb3a[i]=4; else if a_testbtp[i]=4 and 6<=a_testbno[i]<=10 then a_testb3a[i]=5; else if a_testbtp[i]=4 and 11<=a_testbno[i]<=95 then a_testb3a[i]=6; else a_testb3a[i]=8; ***Not ascertained; ***FILL CANCER SCREEN RECODE TIME CATEGORIES VERSION "B" USING 2000,2003 METHOD; if a_testbhad[i] ne 1 then a_testb3b[i]=.; **MONTHS; else if 0<=a_testbmosago[i]<=12 then a_testb3b[i]=1; else if 13<=a_testbmosago[i]<=24 then a_testb3b[i]=2; else if 25<=a_testbmosago[i]<=36 then a_testb3b[i]=3; else if 37<=a_testbmosago[i]<=60 then a_testb3b[i]=4; else if 61<=a_testbmosago[i]<=120 then a_testb3b[i]=5; else if 121<=a_testbmosago[i] then a_testb3b[i]=6; **TIME UNIT AND NUMBER; else if a_testbtp[i]=1 and 1<=a_testbno[i]<=94 then a_testb3b[i]=1; else if a_testbtp[i]=2 and 1<=a_testbno[i]<=52 then a_testb3b[i]=1; else if a_testbtp[i]=2 and 53<=a_testbno[i]<=94 then a_testb3b[i]=2; else if a_testbtp[i]=3 and 1<=a_testbno[i]<=12 then a_testb3b[i]=1; else if a_testbtp[i]=3 and 13<=a_testbno[i]<=24 then a_testb3b[i]=2; else if a_testbtp[i]=3 and 25<=a_testbno[i]<=36 then a_testb3b[i]=3; else if a_testbtp[i]=3 and 37<=a_testbno[i]<=60 then a_testb3b[i]=4; else if a_testbtp[i]=3 and 61<=a_testbno[i]<=94 then a_testb3b[i]=5; else if a_testbtp[i]=4 and a_testbno[i] = 1 then a_testb3b[i]=1; else if a_testbtp[i]=4 and a_testbno[i] = 2 then a_testb3b[i]=2; else if a_testbtp[i]=4 and a_testbno[i] = 3 then a_testb3b[i]=3; else if a_testbtp[i]=4 and 4<=a_testbno[i]<= 5 then a_testb3b[i]=4; else if a_testbtp[i]=4 and 6<=a_testbno[i]<=10 then a_testb3b[i]=5; else if a_testbtp[i]=4 and 11<=a_testbno[i]<=95 then a_testb3b[i]=6; else if a_testb2[i]>0 then a_testb3b[i]=a_testb2[i]; else a_testb3b[i]=8; ***Not ascertained; end; run; ***create permanent NHIS 2005 cancer recode (NAF section) dataset; data nhis.NAF2005; set nhis2005; ***Apply existing formats from the cancerxx file to the new variables; format rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b cap253x. rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b cap177x. ; ***Keep the new variables and ID variables; keep hhx fmx fpx rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b; run; proc contents data=nhis.NAF2005; run; PROC freq; tables rmam3a rmam3b rpap3a rpap3b rpsa3a rpsa3b rcre3a rcre3b rhfob3a rhfob3b rofob3a rofob3b; title 'NHIS NAF 2005 Cancer time category recodes freqs'; title2 'Recodes "A" use all available data, Recodes "B" use 2000/2003 method'; run;