View source: R/zscores_NHANES3.R
zscore_NHANES3 | R Documentation |
This function takes absolute spirometry measurements (FEV1, FVC, etc) in lt plus demographic data (age, height, gender and ethnicity) and converts them to z-scores based on the NHANES III equations.
zscore_NHANES3(
age,
height,
gender = 1,
ethnicity = 1,
FEV1 = NULL,
FVC = NULL,
FEV1FVC = NULL,
PEF = NULL,
FEF2575 = NULL,
FEV6 = NULL,
FEV1FEV6 = NULL
)
age |
Age in years |
height |
Height in meters |
gender |
Gender (1 = male, 2 = female) or a factor with two levels (first = male). Default is 1. |
ethnicity |
Ethnicity (1 = Caucasian, 2 = African-American, 3 = Mexican-American). Default is 1. |
FEV1 |
Forced Expiratory Volume in 1 second (lt) |
FVC |
Forced Vital Capacity (lt) |
FEV1FVC |
FEV1 / FVC ratio |
PEF |
Peak Expiratory Flow (lt) |
FEF2575 |
Forced Expiratory Flow between 25% and 75% of FVC (lt/s) |
FEV6 |
Forced Expiratory Volume in 6 seconds (lt) |
FEV1FEV6 |
FEV1 / FEV6 ratio |
At least one of the spirometric measurement arguments must be set (i.e. be
non-NULL
). Arguments age
, height
, gender
and
ethnicity
must be vectors of length equal to the length of the
spirometric measurement vector(s), or of length one, in which case their
value is recycled. If any input vector is not of equal length, the function
stops with an error.
Normal distributions are assumed for all parameters, even though per the NHANES III equations paper (Hankinson et al) this was observed only for FEV1, FVC, PEF and FEV6.
If only one spirometry argument is supplied, the function returns a numeric vector. If more are supplied, the function returns a data.frame with the same number of columns.
# Random data, 4 patients, one parameter supplied (FEV1)
zscore_NHANES3(age=seq(25,40,4), height=c(1.8, 1.9, 1.75, 1.85),
gender=c(2,1,2,1), ethnicity=rep(1,4), FEV1=c(3.5, 4, 3.6, 3.9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.