nhanes_quantile: Compute quantiles from NHANES weighted survey data

View source: R/quantiles.R

nhanes_quantileR Documentation

Compute quantiles from NHANES weighted survey data

Description

Compute quantiles from NHANES weighted survey data

Usage

nhanes_quantile(
  nhanes_data,
  column,
  comment_column = "",
  weights_column = "",
  quantiles = seq(0, 1, 0.25),
  filter = NULL,
  ...
)

Arguments

nhanes_data

data frame containing NHANES data

column

column name of the variable to compute quantiles for

comment_column

comment column name of the variable for checking if computed quantiles are below the LOD

weights_column

name of the weights column

quantiles

numeric or vector numeric of quantiles to compute

filter

logical expression used to subset the data

...

additional arguments passed to svyquantile

Value

a data frame

Examples


## Not run: 
dat <- nhanes_load_data("UHG_G", "2011-2012", demographics = TRUE)

# Compute 50th, 95th, and 99th quantiles
nhanes_quantile(dat, "URXUHG", "URDUHGLC", "WTSA2YR", c(0.5, 0.95, 0.99))

## End(Not run)


SilentSpringInstitute/RNHANES documentation built on Feb. 15, 2024, 11:26 p.m.