********************************************************************************************* ********************************************************************************************* ** ** ** Program: 01_AnalysisDataset.sas ** ** Purpose: This program loads variable formats and reads in the cohort dataset ** ** that includes all individuals 40+ who participated in all questionnaire ** ** components (N=8,282), then removes patients according to the following ** ** inclusion/exclusion criteria: ** ** (1) Restrict to individuals who completed self-rated hearing and ** ** hearing aid questions (N=8,103). ** ** (2) Further restrict to individuals who completed falls and balance ** ** questions (N=8,091). ** ** Then, this program creates survey weights for the combined cycles, ** ** creates indicators for variables to be used in regression models, ** ** and outputs an analysis dataset that includes the final analytic ** ** cohort (N=8,091) individuals included in the analyses. ** ** ** ** Finally, this program restricts the final analytic cohort to those ** ** participnts from the 2001 and 2003 cycles who completed the romberg ** ** test and assigns appropariate sample weights for the sub-analysis, ** ** then outputs the sub-analysis dataset (N = 4,118). ** ** ** ********************************************************************************************* *********************************************************************************************; *********************** * Assign Data Library * ***********************; LIBNAME Riska 'C:\\Desktop'; /* revise path name as appropriate */ *************************** * Create Variable Formats * ***************************; %INCLUDE "C:\\Desktop\00_Formats.sas"; /* revise path name as appropriate */ ************************** * Read in Cohort Dataset * **************************; DATA Cohort; SET Riska.Cohort; PROC CONTENTS DATA=Cohort; RUN; ************************************************** * Create Variables of Interest and Apply Formats * **************************************************; * Hearing Variables *; DATA Cohort; SET Cohort; IF AUQ150 = 2 THEN Hearing_Aid = 1; /* Never */ IF AUQ150 = 7 THEN Hearing_Aid = 7; /* Refused */ IF AUQ150 = 9 THEN Hearing_Aid = 9; /* Don't Know */ IF AUQ150 = 1 AND AUQ180 = 1 THEN Hearing_Aid = 2; /* Almost Always */ IF AUQ150 = 1 AND AUQ180 = 2 THEN Hearing_Aid = 3; /* At least once a day */ IF AUQ150 = 1 AND AUQ180 = 3 THEN Hearing_Aid = 4; /* At least once a week */ IF AUQ150 = 1 AND AUQ180 = 4 THEN Hearing_Aid = 5; /* At least once a month */ IF AUQ150 = 1 AND AUQ180 = 5 THEN Hearing_Aid = 6; /* Less frequently than a month */ FORMAT Hearing_Aid Aidfmt.; FORMAT AUQ130 auq130fmt.; RUN; * Balance Variables *; DATA Cohort; SET Cohort; FORMAT BAQ010 YNfmt.; FORMAT BAQ020A YNfmt.; FORMAT BAQ020B YNfmt.; FORMAT BAQ020C YNfmt.; Balance = BAQ020B; Falls = BAQ020C; IF BAQ010 = 2 THEN DO; Balance = 2; Falls = 2; END; FORMAT Balance YNfmt.; FORMAT Falls YNfmt.; RUN; * Vision *; DATA Cohort; SET Cohort; IF VIQ010 = 2 THEN VIQ030 = 5; IF VIQ030 = . THEN VIQ030 = 99; FORMAT VIQ030 VIQ030fmt.; RUN; * Diabetes *; DATA Cohort; SET Cohort; FORMAT DIQ010 DIQ010fmt.; RUN; * Smoking Status *; DATA Cohort; SET Cohort; IF SMQ020 = 2 THEN Smoke_cat = 1; /* Never */ IF SMQ020 = 7 THEN Smoke_cat = 7; /* Refused */ IF SMQ020 = 9 THEN Smoke_cat = 9; /* Don't Know */ IF SMQ020 = 1 AND SMQ040 IN (1,2) THEN Smoke_cat = 3; /* Current */ IF SMQ020 = 1 AND SMQ040 = 3 THEN Smoke_cat = 2; /* Former */ IF Smoke_cat = . THEN Smoke_cat = 99; /* Missing */ FORMAT Smoke_cat SMK.; RUN; * Hypertension *; DATA Cohort; SET Cohort; IF BPQ020 = 1 AND BPQ030 = 1 THEN HBP = 1; /* Yes */ IF BPQ020 = 1 AND BPQ030 = 2 THEN HBP = 2; /* No */ IF BPQ020 = 2 THEN HBP = 2; /* No */ IF BPQ020 = 7 THEN HBP = 7; /* Refused */ IF BPQ020 = 9 THEN HBP = 9; /* Don't Know */ IF BPQ020 = 1 AND BPQ030 = 9 THEN HBP = 9; /* Don't Know */ IF BPQ020 = . THEN HBP = 99; /* Missing */ FORMAT BPQ020 DIQ010fmt.; FORMAT BPQ030 DIQ010fmt.; FORMAT HBP DIQ010fmt.; RUN; * Stroke *; DATA Cohort; SET Cohort; IF MCQ160F = . THEN MCQ160F = 99; FORMAT MCQ160F DIQ010fmt.; RUN; * BAX Variables - Modified Romberg Test *; DATA Cohort; SET Cohort; IF BAX = 1 THEN romberg_pass = 0; IF BAXPFC41 = 1 or BAXPFC42 = 1 THEN romberg_pass = 1; FORMAT BAAEXSTS BAAEXSTSfmt. BAAEXCMT BAAEXCMTfmt. BAQ110 YNfmt. BAQ120 YNfmt. BAQ130 YNfmt.; RUN; ************************************************************************************** * Restrict to individuals who completed self-rated hearing and hearing aid questions * **************************************************************************************; DATA Restrict1; SET Cohort; WHERE AUQ130 IN (1,2,3,4) AND Hearing_Aid IN (1,2,3,4,5,6); RUN; ********************************************************************* * Restrict to individuals who complated falls and balance questions * *********************************************************************; DATA Restrict2; SET Restrict1; WHERE Balance IN (1,2) AND Falls IN (1,2); RUN; **************************************************** * Create Survey Weights for Combined NHANES Cycles * ****************************************************; DATA AnalysisCohort; SET Restrict2; * Create Exam Weights *; IF sddsrvyr=1 OR sddsrvyr=2 THEN MEC6YR = 2/3 * WTMEC4YR ; * for 1999-2002 *; IF sddsrvyr=3 THEN MEC6YR = 1/3 * WTMEC2YR ; * for 2003-2004 *; * Create Interview Weights *; IF sddsrvyr=1 OR sddsrvyr=2 THEN INT6YR = 2/3 * WTINT4YR ; * for 1999-2002 *; IF sddsrvyr=3 THEN INT6YR = 1/3 * WTINT2YR ; * for 2003-2004 *; RUN; ******************************************* * Create Indicators for Regression Models * *******************************************; DATA AnalysisCohort; SET AnalysisCohort; Falls_Y = 1*(Falls = 1); LABEL Falls_Y = 'Falls Yes'; Falls_N = 1*(Falls = 2); LABEL Falls_N = 'Falls No'; Balance_Y = 1*(Balance = 1); LABEL Balance_Y = 'Balance Yes'; Balance_N = 1*(Balance = 2); LABEL Balance_N = 'Balance No'; Gender_M = 1*(RIAGENDR = 1); LABEL Gender_M = 'Gender Male' ; Gender_F = 1*(RIAGENDR = 2); LABEL Gender_F = 'Gender Female' ; Educ_L9 = 1*(DMDEDUC2 = 1); LABEL Educ_L9 = 'Education Less than 9th Grade'; Educ_9_11 = 1*(DMDEDUC2 = 2); LABEL Educ_9_11 = 'Education 9th-11th Grade'; Educ_HS = 1*(DMDEDUC2 = 3); LABEL Educ_HS = 'Education High School grad/GED or Equivalent'; Educ_SC = 1*(DMDEDUC2 = 4); LABEL Educ_SC = 'Education Some College or AA Degree'; Educ_C = 1*(DMDEDUC2 = 5); LABEL Educ_C = 'Education College Graduate or Above'; Educ_O = 1*(DMDEDUC2 IN (.,7,9,99)); LABEL Educ_O = "Education Refused/Don't Know/Missing"; Race_MA = 1*(RIDRETH1 = 1); LABEL Race_MA = 'Race Mexican American'; Race_OH = 1*(RIDRETH1 = 2); LABEL Race_OH = 'Race Other Hispanic'; Race_NHW = 1*(RIDRETH1 = 3); LABEL Race_NHW = 'Race Non-Hispanic White'; Race_NHB = 1*(RIDRETH1 = 4); LABEL Race_NHB = 'Race Non-Hispanic Black'; Race_O = 1*(RIDRETH1 = 5); LABEL Race_O = 'Race Other Race - Including Multi-Racial'; Race_M = 1*(RIDRETH1 = .); LABEL Race_M = 'Race Missing'; Aid_N = 1*(Hearing_Aid = 1); LABEL Aid_N = 'Hearing Aid Never'; Aid_AA = 1*(Hearing_Aid = 2); LABEL Aid_AA = 'Hearing Aid Almost Always'; Aid_OD = 1*(Hearing_Aid = 3); LABEL Aid_OD = 'Hearing Aid At least once a day'; Aid_OW = 1*(Hearing_Aid = 4); LABEL Aid_OW = 'Hearing Aid At least once a week'; Aid_OM = 1*(Hearing_Aid = 5); LABEL Aid_OM = 'Hearing Aid At least once a month'; Aid_LM = 1*(Hearing_Aid = 6); LABEL Aid_LM = 'Hearing Aid Less frequently than a month'; Aid_O = 1*(Hearing_Aid IN (.,7,9,99)); LABEL Aid_O = "Hearing Aid Refused/Don't Know"; Hand_Gd = 1*(AUQ130 = 1); LABEL Hand_Gd = 'Handicap Good'; Hand_Lit = 1*(AUQ130 = 2); LABEL Hand_Lit = 'Handicap Little trouble'; Hand_Lot = 1*(AUQ130 = 3); LABEL Hand_Lot = 'Handicap Lot of trouble'; Hand_Df = 1*(AUQ130 = 4); LABEL Hand_Df = 'Handicap Deaf'; Hand_O = 1*(AUQ130 IN (.,7,9)); LABEL Hand_O = "Handicap Refused/Don't Know"; Vision_E = 1*(VIQ030 = 1); LABEL Vision_E = 'Vision Excellent'; Vision_G = 1*(VIQ030 = 2); LABEL Vision_G = 'Vision Good'; Vision_F = 1*(VIQ030 = 3); LABEL Vision_F = 'Vision Fair'; Vision_P = 1*(VIQ030 = 4); LABEL Vision_P = 'Vision Poor'; Vision_VP = 1*(VIQ030 = 5); LABEL Vision_VP = 'Vision Very Poor'; Vision_O = 1*(VIQ030 IN (.,7,9,99)); LABEL Vision_O = "Vision Refused/Don't Know/Missing"; Diabetes_Y = 1*(DIQ010 = 1); LABEL Diabetes_Y = 'Diabetes Yes'; Diabetes_N = 1*(DIQ010 = 2); LABEL Diabetes_N = 'Diabetes No'; Diabetes_B = 1*(DIQ010 = 3); LABEL Diabetes_B = 'Diabetes Borderline'; Diabetes_O = 1*(DIQ010 IN (.,7,9,99)); LABEL Diabetes_O = "Diabetes Refused/Don't Know/Missing"; Smoke_N = 1*(Smoke_cat = 1); LABEL Smoke_N = 'Smoke Never'; Smoke_F = 1*(Smoke_cat = 2); LABEL Smoke_F = 'Smoke Former'; Smoke_C = 1*(Smoke_cat = 3); LABEL Smoke_C = 'Smoke Current'; Smoke_O = 1*(Smoke_cat IN (.,7,9,99)); LABEL Smoke_O = "Smoke Refused/Don't Know/Missing"; HBP_Y = 1*(HBP = 1); LABEL HBP_Y = 'High Blood Pressure Yes'; HBP_N = 1*(HBP = 2); LABEL HBP_N = 'High Blood Pressure No'; HBP_O = 1*(HBP IN (.,7,9,99)); LABEL HBP_O = "High Blood Pressure Refused/Don't Know/Missing"; Stroke_Y = 1*(MCQ160F = 1); LABEL Stroke_Y = 'Stroke Yes'; Stroke_N = 1*(MCQ160F = 2); LABEL Stroke_N = 'Stroke No'; Stroke_O = 1*(MCQ160F IN (.,7,9)); LABEL Stroke_O = "Stroke Refused/Don't Know/Missing"; RUN; ************************************** * Output Dataset for Analysis Cohort * **************************************; DATA Riska.AnalysisCohort; SET AnalysisCohort; RUN; ********************************************************************* * For the sub analysis * *********************************************************************; ************************************************************************************** * Restrict to individuals who participated in the romberg test, years 2001 and 2003 * **************************************************************************************; DATA SubAnalysisCohort; SET AnalysisCohort; WHERE BAX = 1 and sddsrvyr in (2, 3); /* delete those without complete romberg exam data */ IF BAAEXSTS ne 1 THEN DELETE; WTSBA0103 = 1/2 * WTMEC2YR; RUN; ****************************************** * Output Dataset for Sub-Analysis Cohort * ******************************************; DATA Riska.SubAnalysisCohort; SET SubAnalysisCohort; RUN;