Task 2: How to assess a study population using the NHANES-Medicare linked data

This task will go through the steps needed to estimate the number of survey participants available for analysis for our study population defined as survey participants aged 65 years and older, without missing body measure index (BMI) data.

Step 1: Produce frequency distributions of obesity for ages 65 and older from the NHANES file linked with Medicare and with claims on the 2005 Carrier File.

Download, open and run the program, SAS Code for Medicare, linked below.

Explanation of SAS Code to Examine Contingency Table Cells
Statements Explanation
options ls=120 ps=42 missing=' ' nocenter validvarname=upcase compress=binary nodate nonumber; Log/List options.  Compress option reduces storage requirements for output datasets.
libname nhanes 'C:\NHANES'; Provides location for reading and saving SAS datasets.

proc format;
        1 = 'Linked'
        2 = 'Not Linked'
        3 = 'Ineligible';

  value ON_FILE

  value OBESE_
              0='Not Obese';

Creates formats, CMSMATCH, ON_FILE, AND OBESE_ based on the values of the variables CMS_MEDICARE_MATCH, ON_CARRIER_2005, and OBESE, respectively.
proc freq data=ds1 ; The tabulate procedure is used to produce a formatted table displaying counts and percentages.
Tables (CMS_MEDICARE_MATCH ON_CARRIER_2005)*OBESE; The table statement describes a two-dimensional table to be printed. 
Where ridageyr>=65; Limits the study population to adults who were aged ≥65 years at the NHANES interview.
format CMS_MEDICARE_MATCH cmsmatch. ON_CARRIER_2005 on_file. OBESE obese_.; This format statement uses the user-written formats that have been previously defined in PROC FORMAT.
Title "Merged NHANES Feasibility Data Frequency Distribution of obesity by Medicare Match Status"; This title statement identifies the contents of the output.

Step 2: Check the results

To check the results of your program, review the SAS log and output (.lst) reports. Your output should resemble the table below. Note that the total count of NHANES-CMS Medicare eligible and linked respondents who are obese=843. However, the number of linked respondents who are obese with claims on the Carrier file=610. These counts are unweighted.


Adults aged 65 years and older in 1999-2004 NHANES who linked with Medicare data by obesity.
Linked 2159 843
Not Linked 42 9
Ineligible 346 157
Total 2,547 1,009

Adults aged 65 years and older in 1999-2004 NHANES who have claims in the 2005 Carrier File in the Medicare data by obesity.
ON_CARRIER_2005 Not Obese Obese Total
No 674 233 907
Yes 1485 610 2,095


close window icon Close Window to return to module page.