***********************************************************************************************; ********************************Course 3 SAS Program - Medicare********************************; ***********************************************************************************************; ***********************************************************************; *Course 3, Module 10, Task 2 - Assessment of a Study Population********; *How to Assess a Study Population using the NHANES-Medicare Linked Data; ***********************************************************************; /*******************************************************************/ * Filename statement specifies local location to which * * NHANES Feasibility .DAT data set was copied * * libname statements specifies local location of permanent * * SAS data set to be created * /*******************************************************************/; options ls=120 ps=42 missing=' ' nocenter validvarname=upcase compress=binary nodate nonumber mprint mlogic; /****************************************************************************************/ *Before you start, download the NHANES 2007-2008, 2009-2010 and 2011-2012 files from * *ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/datalinkage/feasibility_study_data/CMS/ * *Also download the demographic (DEMO) and body measurement (BMX) files for * *NHANES 2007-2008, 2009-2010 and 2011-2012. These file can be found at * *https://wwwn.cdc.gov/nchs/nhanes/default.aspx * *Enter the file paths below at lines 27 and 63 * /****************************************************************************************/; %macro feasibility (feasfile,demofile,bmxfile,year); filename intext "C:\Feasibility Study Data\MCARE_FEAS_&feasfile..dat" ; data FEAS_&feasfile ; infile intext lrecl=128 ; attrib PUBLICID length=$14 label='NCHS Survey Identifier - Participant Identification Number' SEQN length=5 format=Z5. label='NCHS Survey Identifier - Sample Sequence Number' PATNUM length=6 format=Z6. label='NCHS Survey Identifier - Patient/Discharge Record Number' RESNUM length=6 format=Z6. label='NCHS Survey Identifier - Resident Record (Case) Number' CMS_MEDICARE_MATCH length=3 format=1. label='CMS MEDICARE MATCH STATUS' ON_MBSF_2013 length=3 format=1. label='ON MBSF FILE INDICATOR (2013)' ON_PDE_2013 length=3 format=1. label='ON PDE FILE INDICATOR (2013)'; input /* Survey ID Variables */ @ 1 PUBLICID $CHAR14. @ 1 SEQN 5. @ 1 RESNUM 6. @ 1 PATNUM 6. /* Linkage to CMS Medicare Admin Data */ @ 15 CMS_MEDICARE_MATCH 1. /* Master Beneficiary Summary File: Positions 16 - 30 */ @ 30 on_MBSF_2013 1. /* Part D Prescription Drug Event File: Positions 121 - 128 */ @ 128 on_PDE_2013 1.; run ; libname xp xport "C:\Feasibility Study Data\&demofile..xpt"; proc copy in=xp out=work; run; proc sort data=&demofile; by seqn; run; libname xp xport "C:\Feasibility Study Data\&bmxfile..xpt"; proc copy in=xp out=work; run; proc sort data=&bmxfile; by seqn; run; data Merged&year; length seqn 8.; merge FEAS_&feasfile &demofile &bmxfile; by seqn; keep seqn CMS_MEDICARE_MATCH ON_MBSF_2013 ON_PDE_2013 BMXBMI RIDAGEYR; run; %mend feasibility; %feasibility (NHANES_2007_2008,demo_e,bmx_e,_0708); %feasibility (NHANES_2009_2010,demo_f,bmx_f,_0910); %feasibility (NHANES_2011_2012,demo_g,bmx_g,_1112); proc format; value CMSMATCH 1 = 'Linked' 2 = 'Not Linked' 3 = 'Linked-Child' 9 = 'Ineligible'; value ON_FILE 1='Yes' 0='No'; value OBESE 1='Obese' 0='Not Obese'; run; Data Merged_0712; set Merged_0708 Merged_0910 Merged_1112; *create obesity indicator; If BMXBMI>=30 then obese=1; Else if 0=65; format CMS_MEDICARE_MATCH cmsmatch. ON_PDE_2013 on_file. OBESE obese.; Title "Merged NHANES Feasibility Data Frequency Distribution of Obesity by Medicare Match Status"; run; 国产精品久久久久久一级毛片