p2y | R Documentation |
Converts centile scores into measurements (KG, CM, ...) using one or more external reference distributions.
p2y(
p,
x,
refcode,
pkg = "centile",
verbose = FALSE,
dec = 3L,
rule = 1L,
tail_adjust = FALSE,
scale = 100,
...
)
p |
A numerical vector with centiles. |
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(p)
elements containing the measurements.
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
field (before calculation of y
) and
the yt
field (after calculating of y
), so that the y
have the original
units even if the reference is based on some transform of y
.
Functions p2y()
and y2p()
functions are the inverse of each other.
Stef van Buuren, 2021
# Obtain the 10th, 50th and 90th height centile for a boy aged 1 yr on WHO
p2y(c(10, 50, 90), rep(1, 3), "who_2006_hgt_male_")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.