This package provides 342 NHANES datasets, automatically updated annually with data from 1999-2023 (excluding the 2019-2020 cycle).
library(nhanesdata)
# Load demographics data
demo <- read_nhanes('demo')
# Search for variables
term_search('blood pressure')Easter Egg: Mortality Linkage Data
The package includes harmonized NHANES-linked mortality data accessible via
read_nhanes("mortality"). This dataset links NHANES participants to death certificate records from the National Death Index (NDI), enabling survival analysis and mortality risk studies.Key features:
* Follow-up through December 31, 2019
* Cause-specific mortality (ICD-10 codes)
* Person-months of follow-up
* Vital status and mortality flagsImportant: Mortality linkage requires understanding of survey weights, censoring, and survival analysis methods. Always consult the NCHS data linkage documentation and the NHANES analytic guidelines before analyzing mortality outcomes.
See the Public-Use Linked Mortality Files for methodology and variable definitions.
Questionnaire/Interview Tables - Self-reported data from participant interviews
Examination Tables - Physical measurements and laboratory results
The CB column indicates whether each datasetβs categorical variable labels have been cross-validated against CDC codebooks across all survey cycles (1999β2023).
| Symbol | Meaning |
|---|---|
| β | Verified β Per-cycle CDC codebooks were compared and all labels confirmed correct across cycles. |
| π | Unverified β No CDC codebook was available for automated cross-validation. These are predominantly continuous laboratory values where label drift does not apply. The data is correct; only the independent label audit could not be performed. |
| π οΈ | Fix applied β A label discrepancy was found and corrected. See below. |
| β οΈ | Caution β Known label text changes across survey cycles. See below. |
The 2001β2002 cycle codebook (CDQ_B) listed raw numeric
values (β1β, β2β, β¦, β8β) as labels for variables
CDQ009AβCDQ009H instead of the descriptive
pain-location text used in all other cycles. This was a CDC codebook
deficiency, not a change in questionnaire meaning. The corrected labels
(e.g., βPain in right armβ, βPain in left chestβ) now match the
descriptive text from the 2003+ codebooks.
CDC updated descriptive labels for 111 dental coding variables across
survey cycles. The underlying numeric codes retain their original
meaning β for example, tooth condition code 2 consistently
means βpermanent toothβ whether the label reads βPermanent tooth
(succedaneous)β (2001) or βPermanent tooth presentβ (2009+). Similarly,
code 3 means βimplantβ regardless of whether the label is
βImplantβ or βDental Implant.β These are cosmetic label refinements by
CDC, not changes in clinical coding. Researchers performing cross-cycle
analyses should be aware that label text may differ by era.
year and seqn columns for
mergingFor detailed variable information, use term_search() or
visit the CDC NHANES
website.
Warning: CDC may change data periodically. The data was aggregated as best as possible to reconcile variable types that changed across cycles. ALWAYS reference the CDC documentation with
nhanesdata::get_url(dataset)!See
get_url()documentation.