************************************************************************************************* * 06/2014 * * SAS PROGRAM FOR RECREATING NHIS RECODES PERTAINING TO "TIME SINCE CANCER * SCREENING TEST" FOR 2003 DATA * * Background: * In 2003 some of the NAF "time since cancer screening test" recodes were miscalculated * (specifically, colorectal screening exams, and fecal occult blood (FOB) tests). * The following code uses the same estimation method used in 2000, and is * consistent with the methods used in 2000 by the National Cancer Institute * and the Office of Analysis and Epidemiology, National Center for Health Statistics. * * This program recreates the recodes using the method referred to as Method "B" in the * 2005 and 2008 CANRECO.SAS programs. * * As an example, the recoded variables (RMam3B, RPap3B, etc.) are based on these * methods: * - If a person reported a test "1 year ago", the test is counted as 12 * months ago. If a person reported a test "2 years ago", the test is * counted as 24 months ago, etc. * - If a person reported the year of the test but not the month, the test * is assigned to July of that year. Day of test is set to 15 for all * respondents with any date information (i.e., 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 HOUSEHOLD AND SAMPLE ADULT SAS DATASETS*/ /*USE NHIS SAS PROGRAMS TO CREATE FILES AND FORMATS*/ /*USER NOTE: MODIFY SET UP OF LIBNAMES AND FILEREFS AS NEEDED*/ ***Input files; LIBNAME NHIS 'C:\NHIS2003\'; LIBNAME LIBRARY 'C:\NHIS2003\'; ***************************** *update screening recodes * *****************************; **SORT FILES BY HOUSEHOLD IDENTIFIER; proc sort data=nhis.samadult out=sa2003; by hhx; run; proc sort data=nhis.househld out=hh2003; by hhx; run; data nhis2003; **MERGE SAMPLE ADULT AND HOUSEHOLD KEEPING INTERVIEW MONTH AND YEAR FROM HOUSEHOLD; merge sa2003(in=sa) hh2003(keep=hhx int_m_p int_y_p); by hhx; if sa; **SET INTERVIEW DAY to 15th of INTERVIEW MONTH; label intdate = 'Interview date (set to 15th of the month)'; intdate = mdy(int_m_p, 15, int_y_p); format intdate mmddyy10.; **PART 1; ***CREATE CANCER SCREEN VARIABLES WITH FIVE(5) TIME CATEGORIES; ***MAMMOGRAM, PAP SMEAR, PROSTATE-SPECIFIC ANTIGEN TEST; label RMam3B = 'Most recent mammogram, time categories recode' RPap3B = 'Most recent Pap test, time categories recode' RPSA3B = 'Most recent PSA test, time categories recode' ; 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[*] rmam_mo2 rpap_mo2 rpsa_mo2; array a_testahad[*] mamhad paphad psahad ; array a_testatp[*] rmam1_tp rpap1_tp rpsa1_tp ; array a_testano[*] rmam1_no rpap1_no rpsa1_no ; array a_testa2[*] rmam2ca rpap2ca rpsa2 ; 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]=int_y_p then a_testamosago[i]=0; else put 'Invalid test/interview date combination - five time categories. ' hhx= fmx= px= a_testayr[i]= a_testamt[i]= int_y_p= int_m_p=; end; ***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; **FILL WITH TIME CATEGORY LAST; 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; **IN 2003 DATA RELEASE THESE TWO(2) RECODES WERE MISSING ONE TIME CATEGORY; ***COLORECTAL EXAM, HOME FECAL OCCULT BLOOD TEST; label RCRE3B = 'Most recent colorectal endoscopy, time categories recode' RHFOB3B = 'Most recent home blood stool test, time categories recode' ; array a_testbmt[*] rcre1_mt rhfob1_m ; array a_testbyr[*] rcre1_yr rhfob1_y ; array a_testbdate[*] credate hfobdate ; array a_testbmosago[*] rcre_mo2 rhfo_mo2 ; array a_testbhad[*] crehad hfobhad ; array a_testbtp[*] rcre1_tp rhfob1_t ; array a_testbno[*] rcre1_no rhfob1_n ; array a_testb2[*] rcre2 rhfob2 ; array a_testb3b[*] rcre3B rhfob3B ; **CALCULATING VERSION "B" CANCER SCREEN RECODES USING 2000, 2003 METHOD; do i = 1 to dim(a_testb3b); **IF TEST YEAR IS VALID; if .12 and a_testbyr[i]=int_y_p then a_testbmosago[i]=0; else put 'Invalid test/interview date combination - six time categories.' hhx= fmx= px= a_testbyr[i]= a_testbmt[i]= int_y_p= int_m_p=; end; ***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; **FILL WITH TIME CATEGORY LAST; else if a_testb2[i]>0 then a_testb3b[i]=a_testb2[i]; else a_testb3b[i]=8; ***Not ascertained; end; run; ********************************************************************* * UPDATE FORMATS: * * The data value of variables RCRE_MO2, RHFO_MO2, RMAM_MO2, * * RPAP_MO2 and RPSA_MO2 are updated after using method "B". * * The code below re-defines original formats SAP630X and SAP602X * * for these variables, allowing a higher maximum value for * * months since last cancer screening test. The original formats * * were created and permanently stored in the library when * * generating sample adult file. * *********************************************************************; proc format lib=nhis.formats cntlout=fmtdata; select sap630x sap602x; run; proc sql; ***UPDATE SAP630X **; update fmtdata set end='900', label="121-600+ months" where fmtname="SAP630X" and label="121-600 months"; ***UPDATE SAP602X **; update fmtdata set end='900', label="61-600+ months" where fmtname="SAP602X" and label="61-600 months"; ***UPDATE BOTH SAP602X AND SAP630X **; update fmtdata set label="not in univ,or no yr inf" where label=""; ***DELETE FROM BOTH SAP602X AND SAP630X **; delete from fmtdata where label="Refused" or label="Not Ascertained" or label="Don't Know" ; quit; proc format library=nhis.formats cntlin=fmtdata; run; ***CREATE PERMANENT NHIS 2003 CANCER RECODE(NAF section) DATASET; data nhis.naf2003; set nhis2003; **FORMAT NEW RECODES USING EXISTING AND UPDATED FORMATS IN SAMPLE ADULT FILE; format rmam3B rpap3B rpsa3B sap601x. rcre3B rhfob3B sap631x. rcre_mo2 rhfo_mo2 sap630x. rmam_mo2 rpap_mo2 rpsa_mo2 sap602x. ; **KEEP UPDATED VARIABLES; keep hhx fmx px rcre3b rhfob3b rmam3b rpap3b rpsa3b rcre_mo2 rhfo_mo2 rmam_mo2 rpap_mo2 rpsa_mo2; run; proc contents data=nhis.naf2003; run; proc freq; tables rmam3b rpap3b rpsa3b rcre3b rhfob3b; title 'NAF 2003 Cancer Screen Time Category Recodes Freqs'; run;