Skip to contents

Discovery

Find available cycles and files

nhanes_cycles()
List available NHANES cycles
nhanes_manifest()
List available files for a NHANES cycle and component

Search the CDC variable catalog by keyword

nhanes_search_variables()
Search NHANES variables by keyword
nhanes_variable_map()
Build a per-cycle variable map for an analyte

Download

Download and cache NHANES XPT files

nhanes_download()
Download and cache NHANES XPT data files
nhanes_download_analyte()
Download NHANES files for an analyte using the CDC variable catalog

Harmonize, stack, and merge

Combine data across cycles and components

nhanes_harmonize()
Harmonize variable names across NHANES cycles and stack into one data frame
nhanes_stack()
Stack NHANES data across multiple cycles
nhanes_merge()
Merge NHANES component data frames by SEQN

Variable labelling

Attach CDC descriptions as Hmisc-style column labels

NH_label()
Attach CDC variable descriptions as Hmisc-style labels
NH_describe()
NHANES-annotated variable descriptions

Mortality linkage

Link National Center for Health Statistics (NCHS) Public-Use Linked Mortality Files

nhanes_mortality_link()
Link mortality data onto an NHANES analytic dataset
nhanes_mortality_download()
Download NHANES Public-Use Linked Mortality Files
nhanes_mortality_parse()
Parse NHANES Linked Mortality Files into data frames
nhanes_lmf_cycles()
List NHANES cycles with a public-use LMF

Survival analysis

Prepare and summarise survival datasets

nhanes_survival_prep()
Prepare an NHANES-LMF dataset for survival analysis
nhanes_followup_summary()
Summarize mortality follow-up by cycle
nhanes_ucod_labels()
Lookup table for UCOD_LEADING cause-of-death codes

Survey-weighted Cox models

Fuse rms and survey Cox fits; compute weighted baseline hazard

svycph_fuse()
Fuse svycoxph and cph objects for rms ecosystem compatibility
weighted_basehaz()
Compute survey-weighted cumulative baseline hazard with variance
svycph_set_basehaz()
Substitute weighted baseline hazard into a fused cph object

Cache management

nhanes_cache_dir()
Get or set the nhanesR local cache directory