y2p | R Documentation |
Converts measurements into age- or hgt-conditional centile scores using one or more external reference distributions.
y2p(
y,
x,
refcode,
pkg = "centile",
verbose = FALSE,
dec = 3L,
rule = 1L,
tail_adjust = FALSE,
scale = 100,
...
)
y |
A numerical vector with measurements'. |
x |
A vector containing |
refcode |
A character vector with |
pkg |
The package containing the references in the |
verbose |
Set to |
dec |
A scalar value indicating the number of decimals used to round the value. The default is 3 decimals. |
rule |
an integer (of length 1 or 2) describing how interpolation
is to take place outside the interval [ |
tail_adjust |
Logical. If |
scale |
The maximum of the scale. The default ( |
... |
Not used. |
A vector with length(y)
elements containing centiles.
The type of reference distribution is defined by the distribution
field
of the study
attribute in the reference. The function executes
transformations specified by the tx
and ty
fields before calculating the
Z-score.
Functions y2p()
and p2y()
functions are the inverse of each other.
Stef van Buuren, 2021
y <- c(50, 50, 60, 60, 4, 4, 4, 4)
x <- c(rep(0.1, 4), rep(0.1, 4))
refcode <- c(
rep(c("who_2006_hgt_male_", "who_2006_hgt_female_"), 2),
rep(c("who_2006_wgt_male_", "who_2006_wgt_female_"), 2)
)
y2p(y, x, refcode)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.