Centers for Disease Control and Prevention


About N C H S graphic and link
InformaciĆ³n en EspaƱol
Fastats A-Z provides health statistics and links to additional sources of information
N C H S help graphic and link
Coming Events graphic and link
Surveys and Data Collection Systems graphic and link
National Health and Nutrition Examination Survey graphic and link
National Health Care Survey graphic and link
National Health Interview Survey graphic and link
National Immunization Survey graphic and link
Longitudinal Studies of Aging (LSOAs)
National Survey of Family Growth graphic and link
State and Local Area Integrated Telephone Survey graphic and link
National Vital Statistics System graphic and link
Initiatives graphic and link
Aging Activities graphic and link
Disease Classification graphic and link
Healthy People graphic and link
Injury graphic and link
Research and Development graphic and link
Research Data Center
NCHS Press Room
News Releases graphic and link
Publications and Information Products graphic and link
Statistical Export and Tabulation System
Listserv graphic and link
Graphic and link to FEDSTATS and other sites
Download graphic
Adobe Acrobat Reader graphic and link
PowerPoint Viewer 2003 graphic and link
National Center for Health Statistics 3311 Toledo Road Hyattsville, Maryland 20782
Toll Free Data Inquiries 1-800-232-4636

 

 

 

 

 

CDC Home Search Health Topics A-Z
N C H S home page graphic and link

Sample Sudaan Code

Program Function

Produces means, standard error of means, 95 percent confidence limits and design, standard deviations which account for the complex sample.

This program creates a file for input into PROC DESCRIPT by merging the file containing the analytic variable of interest, in this case serum total cholesterol, with the demographic file containing the design variables. That is, the full sample weight and the 52 replicate weights as well as age and gender.

Written By:
CDC/NCHS/DHES

Date
August 30, 2002

Notes

Please follow these steps to download the correct file from the NHANES Website and then merge the data file with selected variables from the demographics file: 

1.  Create a folder on your PC titled "C:\My Files\Temp"

2.  In a suitable web browser, go to    http://www.cdc.gov/nchs/about/major/nhanes/ NHANES99_00.htm

3.  Find the "Lab13 Total Cholesterol" link under the "Laboratory Files" area and click on it.  If prompted for a location to download the file to, specify "C:\My Files\Temp".  This will start downloading a self-extracting file, "Lab13 Total Cholesterol.exe" to your machine.

Execute this file once the download is complete. After executing this file a new window will appear on your screen asking where to extract files to.  Specify "C:\My Files\Temp".  Then hit the "extract" button at the bottom left of this window. This action will result in three files in "C:\My Files\Temp": Lab13.pdf (codebook),  Lab13.xpt (SAS transport file), and Lab13DOC.pdf (Lab13 documentation).

4.  Return to the web browser.  Find the "Demographics" link under the "Demographics File" area and click on it.  If prompted for a location to download the file to, specify "C:\My Files\Temp".  This will start downloading a self-extracting file, "demo.exe" to your machine. Execute this file once the download is complete. After executing this file a new window will appear on your screen asking where to extract files to.  Specify "C:\My Files\Temp". Then hit the "extract" button at the bottom left of this window. This action will result in three files in "C:\My Files\Temp":    DEMO.pdf (codebook), DEMO.xpt(SAS transport file), and DEMODOC.pdf (Demographics documentation).

5.  Start your version of the SAS program.  Next copy and paste the SAS program provided below to the SAS program editor window, then click on the Run icon on your SAS toolbar. 

LIBNAME L XPORT 'C:\My Files\Temp\LAB13.xpt';

LIBNAME D XPORT 'C:\My Files\Temp\DEMO.xpt';

**Creates a file for input into PROC DESCRIPT**;

data demo;
 
set d.demo;
run
;
proc
sort data=demo;
by seqn;

run
;

data
chol;
set l.lab13;
run
;
proc
sort data=chol;
by seqn;
run
;

proc
format;
 
value gender 1='Men'
                    
2='Women';

run;
data
comb;
merge demo chol;
  
by seqn; 
  
label lbxtc='Serum total cholesterol'
  
riagendr='Gender'; 
  
stratum=
1
 
age1=
1+(ridageyr>39)+(ridageyr>59);
run
;

**Produces means, standard error of means, 95 percent confidence limits and design, standard deviations which account for the complex sample**;

proc descript data=comb design=jackknife deft;

subpopn ridageyr>=20 & wtmec2yr>=1
**Use wtint2yr for variables based on interview data**;
weight wtmec2yr; 
**Use wtirep01-wtirep52 for variables based on interview data**;
jackwgts wtmrep01-wtmrep52/adjjack=
.980769

subgroup age1 riagendr; 
levels
3 2
var
lbxtc; 
table riagendr*age1; 
print nsum mean semean deffmean/style=NCHS nsumfmt=f8.0 
meanfmt=f8.0 semeanfmt=f8.1;
rtitle "Mean serum total cholesterol of adults 20 years of age and older: United States, 1999-2000"; 
rformat riagendr gender.;

run
;

 

This page last reviewed January 11, 2007

H H S Health and Human Services logo and link
U.S. DEPARTMENT OF HEALTH AND HUMAN SERVICES
Centers for Disease Control and Prevention
National Center for Health Statistics
Hyattsville, MD
20782

1-800-232-4636