/* ======================================================*/ /*===========NYC HANES 2013-14 AND 2004 TUTORIAL===========*/ /* ======================================================*/ /* Created by NYC-HANES 2013-14 Team: Claudia Chernov (cchernov@health.nyc.gov) Rania Kanchi (rania.kanchi@nyumc.org) Lorna Thorpe (lorna.thorpe@nyumc.org) Sharon Perlman (sperlma1@health.nyc.gov) Thanks to Jesica Rodriguez-Lopez for her contribution in creating this sample code /* ======================================================*/ /*======================DISCLOSURE======================*/ /*All material included in this tutorial presentation is available for public use as an educational tool. Results from this tutorial analysis should not be used as official estimates or references for research. /*=======================================================*/ /*=======================================================*/ /*This tutorial Includes: ====================================== - Recoding of variables ====================================== - Weight adjustment due to non-response ======================== - Age standardization ====================================== - Prevalence estimate calculations ============================== - Stratified analysis (Prevalence estimates by gender) ================ - Comparison across years ==================================*/ /*=======================================================*/ /*=======================================================*/ /* DIABETES PREVALENCE ANALYSIS USSING 2004 AND 2013-14 DATA */ /* Objective: Calculate the prevalence of Diabetes in NYC residents, total and by gender, and compare diabetes prevalence across survey years======*/ /*=======================================================*/ /*======================== 2013-14 ========================*/ /*================= PREVALENCE ESTIMATES =================*/ /* Step 1: Call in dataset */ /*Download datasets and format code, and save on your own computer*/ /*For this tutorial, we will assume that datasets and format code are saved in C:\Data\2014*/ libname NYCH14 'C:\Data\2014'; %include 'C:\Data\2014\SAS variable formats_V2_0916.sas'; run; data NYCHANES14; set NYCH14.NYCHANES_2013_14_V2_09212016; run; /* Step 2: Recode/create outcome of interest */ data dbts14; set NYCHANES14; data dbts14; set NYCHANES14; *Define diabetes using FPG or A1c or previous diagnosis of diabetes; /*Diabetic: Fasted and have plasma glucose =>126 or A1C =>6.5 or self-reported diagnosis*/ if DBT_Fasting=1 and (Glucose >=126 or A1c >=6.5) or DIQ_1=1 then dbts=1; /*Diabetic: Did not fast and have A1c =>6.5 or self-reported diagnosis*/ else if DBT_Fasting=2 and (A1c =>6.5 or DIQ_1=1) then dbts=1; /*Non-Diabetic: Fasted and have plasma glucose<126 and A1c<6.5 and no self-reported diagnosis*/ else if DBT_Fasting=1 and (0=126 or A1C>=6.5 or self-reported diagnosis*/ if WTSF1F>0 and (lbxglu>=126 or lbxgh>=6.5) or diq010=1 then dbts=1; /*Diabetic: Did not fast and have A1c>=6.5 or self-reported diagnosis*/ else if WTSF1F<=0 and lbxgh>=6.5 or diq010=1 then dbts=1; /*Non-Diabetic: Fasted and have plasma glucose<126 and A1C<6.5 and no self-reported diagnosis*/ else if WTSF1F>0 and (0