daz: Calculate Development-for-Age Z-score (DAZ)

View source: R/daz.R

dazR Documentation

Calculate Development-for-Age Z-score (DAZ)

Description

The daz() function calculated the Development-for-Age Z-score (DAZ). The DAZ represents a child's D-score after adjusting for age by an external age-conditional reference.

Usage

daz(d, x, reference_table = NULL, dec = 3, verbose = FALSE)

zad(z, x, reference_table = NULL, dec = 2, verbose = FALSE)

Arguments

d

Vector of D-scores

x

Vector of ages (decimal age)

reference_table

A data.frame with the LMS or BCT reference values. The default NULL selects the default reference belonging to the key, as specified in the base_population field in dscore::builtin_keys.

dec

The number of decimals (default dec = 3).

verbose

Print out the used reference table (default verbose = FALSE).

z

Vector of standard deviation scores (DAZ)

Details

The zad() is the inverse of daz(): Given age and the Z-score, it finds the raw D-score.

Note 1: The Box-Cox Cole and Green (BCCG) and Box-Cox t (BCT) distributions model only positive D-score values. To increase robustness, the daz() and zad() functions will round up any D-scores lower than 1.0 to 1.0.

Note 2: The daz() and zad() function call modified version of the pBCT() and qBCT() functions from gamlss for better handling of NA's and rounding.

Value

Unnamed numeric vector with Z-scores of length length(d).

Unnamed numeric vector with D-scores of length length(z).

Author(s)

Stef van Buuren

References

Cole TJ, Green PJ (1992). Smoothing reference centile curves: The LMS method and penalized likelihood. Statistics in Medicine, 11(10), 1305-1319.

See Also

dscore()

Examples

# using default reference and key
daz(d = c(35, 50), x = c(0.5, 1.0))

# print out names of the used reference table
daz(d = c(35, 50), x = c(0.5, 1.0), verbose = TRUE)

# using the default reference in key gcdg
reftab <- get_reference(key = "gcdg")
daz(d = c(35, 50), x = c(0.5, 1.0), reference_table = reftab)

# using Dutch reference in default key
reftab <- get_reference(population = "dutch", verbose = TRUE)
daz(d = c(35, 50), x = c(0.5, 1.0), reference_table = reftab)
# population median at ages 0.5, 1 and 2 years, default reference
zad(z = rep(0, 3), x = c(0.5, 1, 2))

# population median at ages 0.5, 1 and 2 years, gcdg key
reftab <- get_reference(key = "gcdg", verbose = TRUE)
zad(z = rep(0, 3), x = c(0.5, 1, 2), reference_table = reftab)

# population median at ages 0.5, 1 and 2 years, dutch key
reftab <- get_reference(key = "dutch", verbose = TRUE)
zad(z = rep(0, 3), x = c(0.5, 1, 2), reference = reftab)

D-score/dscore documentation built on June 29, 2024, 6:25 p.m.