% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{nhanes_2017}
\alias{nhanes_2017}
\title{NHANES 2017-2018: Demographics and Blood Pressure}
\format{
A data frame with 9,254 rows and 14 variables:
\describe{
\item{seqn}{Respondent sequence number (unique identifier, join key).}
\item{sdmvpsu}{Masked variance pseudo-PSU. Use as the cluster ID for
variance estimation. See Details.}
\item{sdmvstra}{Masked variance pseudo-stratum. Use as the stratification
variable for variance estimation. See Details.}
\item{wtmec2yr}{Full-sample 2-year MEC examination weight. Use for any
analysis involving examination measurements (e.g., blood pressure).}
\item{wtint2yr}{Full-sample 2-year interview weight. Use for analyses
based on interview data only.}
\item{ridstatr}{Interview/examination status: \code{1} = interview only,
\code{2} = both interview and MEC examination.}
\item{riagendr}{Gender: \code{1} = male, \code{2} = female.}
\item{ridageyr}{Age in years at screening, top-coded at 80.}
\item{ridreth3}{Race/Hispanic origin (6 categories): \code{1} = Mexican
American, \code{2} = Other Hispanic, \code{3} = Non-Hispanic White,
\code{4} = Non-Hispanic Black, \code{6} = Non-Hispanic Asian,
\code{7} = Other/Multiracial.}
\item{indfmpir}{Ratio of family income to the federal poverty level
(continuous, 0–5; values >5 are top-coded at 5).}
\item{dmdeduc2}{Education level for adults 20+: \code{1} = Less than 9th grade,
\code{2} = 9th–11th grade, \code{3} = High school graduate/GED, \code{4} = Some
college/AA, \code{5} = College graduate or above.}
\item{bpxsy1}{Systolic blood pressure, 1st reading (mm Hg). \code{NA} if not
examined.}
\item{bpxdi1}{Diastolic blood pressure, 1st reading (mm Hg). \code{NA} if not
examined.}
\item{bpxpls}{60-second pulse rate (beats per minute). \code{NA} if not
examined.}
}
}
\source{
National Center for Health Statistics, CDC. NHANES 2017-2018 Continuous
Survey.
\url{https://www.cdc.gov/nchs/nhanes/}
}
\usage{
nhanes_2017
}
\description{
A merged dataset from the National Health and Nutrition Examination Survey
(NHANES) 2017-2018 cycle, combining demographic characteristics with blood
pressure measurements. Covers all 9,254 sampled participants; blood pressure
variables are \code{NA} for the 550 interview-only participants (\code{ridstatr == 1}).
}
\details{
\strong{Survey design:} Taylor series linearization. When creating a survey
design object, use \code{sdmvpsu} as the cluster ID, \code{sdmvstra} as the stratum,
and \code{wtmec2yr} as the weight for examination-based analyses:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{svy <- as_survey(nhanes_2017,
  ids     = sdmvpsu,
  strata  = sdmvstra,
  weights = wtmec2yr
)
}\if{html}{\out{</div>}}

Use \code{wtint2yr} instead of \code{wtmec2yr} for interview-only variables
(e.g., income, education).

\strong{Metadata:}
All columns carry variable labels and value labels as R attributes,
automatically extracted into surveycore's metadata system when you call
\code{as_survey()}.
\itemize{
\item \strong{Variable labels} (\code{"label"} attribute): A human-readable description of
each column. Example: \code{attr(nhanes_2017$riagendr, "label")} returns
\code{"Gender"}.
\item \strong{Value labels} (\code{"labels"} attribute): A named numeric vector mapping
each code to its meaning. Example: \code{attr(nhanes_2017$riagendr, "labels")}
returns \code{c(Male = 1, Female = 2)}.
}

\strong{Source files:} DEMO_J.xpt (demographics) merged with BPX_J.xpt (blood
pressure) on \code{seqn}. Prepared by \code{data-raw/download-nhanes.R}.
}
\examples{
# All 9,254 participants (interview + exam)
head(nhanes_2017)

# Restrict to exam participants for blood pressure analysis
exam_only <- nhanes_2017[nhanes_2017$ridstatr == 2, ]

# Inspect variable label
attr(nhanes_2017$riagendr, "label")

# Inspect value labels
attr(nhanes_2017$riagendr, "labels")

# Inspect value labels for race/ethnicity
attr(nhanes_2017$ridreth3, "labels")
}
\keyword{datasets}
