transform2z | R Documentation |
This function transforms growth data in the wide matrix
to Z-scores using the selector method implemented in
set_refcodes()
. It is the inverse of transform2y()
.
transform2z(
data,
ynames = c("hgt", "wgt", "hdc", "wfh", "bmi", "dsc"),
pkg = "nlreferences",
verbose = FALSE,
...
)
data |
Data frame with appropriate variables, at least
|
ynames |
Character vector containing the measurements to convert. Specify this to limit the number of conversions. If not specified, the function calculates Z-scores for all measurements. |
pkg |
Name of the package that stores the growth references. By
default, |
verbose |
Set to |
... |
Arguments passed down to |
By default, the function scans for variables named
hgt
, wgt
, hdc
, wfh
, bmi
and dsc
, and returns
Z-scores for any variables it finds.
A data frame with either zero rows or the same number of rows
as nrow(data)
with colums named hgt_z
, wgt_z
, and so on.
Stef van Buuren 2021
set_refcodes()
, centile::y2z()
df <- data.frame(hgt = 60, wgt = 5, hdc = 40, age = 0.3,
sex = "male", ga = c(20, 30, 40, 50))
transform2z(df, ynames = c("hdc", "wfh"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.