Skip directly to search Skip directly to A to Z list Skip directly to navigation Skip directly to site content Skip directly to page options
CDC Home

Continuous NHANES Web Tutorial Sample Code & Datasets

lineYou are at Continuous NHANES contentlineGo to NHANES III contentlineGo to NHANES II contentlineGo to NHANES I contentline

Below is a listing of all the sample code and datasets used in the Continuous NHANES tutorial. They are organized by module and then task. If a module or task is not listed it is because it did not have a related program. Programs are available as SAS programs (i.e. SAS Survey Procedures and SAS-callable SUDAAN)  and Stata programs. The datasets are SAS or Stata datasets for Windows.

These datasets are intended to be used with the tutorial only, as they may contain a subset of the variables available. If you wish to conduct your own analyses, please download the most current and complete datasets from the NHANES website.

Program code used in this tutorial follow procedures available in SAS 9.2, SUDAAN 9.0 or SUDAAN 8.0, and Stata/SE 10.0. Additional programs for SAS 9.1 and R are available at the bottom of this page.

These programs use variable formats listed in the Tutorial Formats page. You may need to format the variables in your dataset the same way to reproduce results presented in the tutorial.

Info icon A regular left-click may not download the SAS datasets or SAS code correctly. Your browser may try to open and attempt to interpret the contents of the dataset or program. If this happens, right-click the link and save the dataset or program to your hard drive. After it has downloaded, the use your statistical software program to open the dataset to view it.


Download Data Files


Append & Merge Datasets

Clean & Recode Data


Format & Label Variables

Save Datasets

Variance Estimation


Descriptive Statistics

Hypothesis Testing

Age Standardization and Population Counts

  • Task 1c: How to Generate Age-Adjusted Prevalence Rates in Stata
  • Task 2a: Generate Population Counts in SUDAAN
  • Task 2b: Generate Population Counts in SAS Survey Procedures
  • Task 2c: Generate Population Counts in Stata

    Linear Regression


    Logistic Regression

    Additional Programs for SAS 9.1


    Additional Programs and Output for R


    To report problems or comments, use the NHANES Web Tutorial email.  Do not direct questions to this email address, as it can only receive feedback and we will not be able to reply.

    Contact Us:
    • National Center for Health Statistics
      3311 Toledo Rd
      Hyattsville, MD 20782
    • 1 (800) 232-4636
    • The U.S. Government's Official Web PortalDepartment of Health and Human Services
    Centers for Disease Control and Prevention   1600 Clifton Road Atlanta, GA 30329-4027, USA
    800-CDC-INFO (800-232-4636) TTY: (888) 232-6348 - Contact CDC–INFO
    A-Z Index
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. G
    8. H
    9. I
    10. J
    11. K
    12. L
    13. M
    14. N
    15. O
    16. P
    17. Q
    18. R
    19. S
    20. T
    21. U
    22. V
    23. W
    24. X
    25. Y
    26. Z
    27. #