Description Slots Author(s) Examples
The xyz
class stores three variables useful for growth curves:
x
(usually age), y
(height, weight, etc) and z
(Z-score,
or standard deviation score (SDS)
corresponding to y
given x
). The class calculates
z
(when y
is specified), or y
(when z
is specified).
x
:Numeric vector of decimal ages (in years) at which
measurements y
and Z-scores z
are made. The length
of x
determines how many measurements (including NA
's)
are stored.
y
:Numeric vector of measurement of length length(x)
.
z
:Numeric vector of Z-score of length length(x)
.
xname
:A character scalar with the name of the x
variable,usually something like "age"
.
yname
:A character scalar with the name of the measurement.
Currently restricted to one of c("hgt", "wgt", "hdc", "wfh", "bmi", "dsc")
for height (in cm), weight (in kg), head circumference (in cm),
weight-for-height (kg/m), body mass index (kg/m^2) and D-score, respectively.
zname
:A character scalar with the name of the z
variable. By default, is it equal to paste0(yname, "_z")
.
call
:An object of class call
that specifies the
appropriate reference table from the clopus package. Use the function
create.reference.call
to set call
manually.
Alternatively, specify one or more of libname
, prefix
,
sex
,
yname
and sub
arguments, which are passed down to
create.reference.call()
. DEPRECATED.
refcode
:Since minihealth 0.90.0
, Name of the reference. See
make_refcode
.
pkg
:Since minihealth 0.90.0
, Name of the package containing
the reference. See make_refcode
. The default is
nlreferences
.
found
:Internal logical flag indicating
whether the reference specified by
call
was actually found.
usetransform
:Logical indicating whether conversion to
and from should be done using nlreferences::transform2z()
and
nlreferences::transform2y()
.
transform
:Name of the nlreferences
transform function.
sex
:Sex specified by user argument.
ga
:Gestational age specified by user argument.
age
:Decimal age specified by user argument.
digits
:Number of digits for round()
function. Default
is 3.
Stef van Buuren
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # specify length (in cm) for boy at ages 0, 0.2 and 0.5 years
d1 <- new("xyz", x = c(0, 0.2, 0.5), y = c(51.0, 54.1, 63.4))
d1
# Z-scores of weight (in kg) at same ages
d2 <- new("xyz", x = c(0, 0.2, 0.5), y = c(3.2, 5.2, 7.0), yname = "wgt",
sex = "female")
d2
# As as data.frame
data.frame(d2)
# Head circumference of girl, relative to WHO standard
d3 <- new("xyz", x = c(0, 0.2, 0.5), y = c(35, 38, 41), pkg = "centile",
refcode = "who_2007_hdc_female_")
d3
data.frame(d3)
# Standard weight centiles at age 0.5 year of Dutch girls
d5 <- new("xyz", x = rep(0.5, 5), z = -2:2, sex = "female", yname = "wgt")
d5
# calculate centiles at 1 year using the female WHO head circumference reference
d6 <- new("xyz", yname = "hdc", x = rep(1, 5), z = -2:2, pkg = "centile",
refcode = "who_2007_hdc_female_")
d6
# calculate P50 for preterms, female and born a GA week 32
d7 <- new("xyz", yname = "hgt", x = seq(0, 1, 1/12), z = rep(0, 13),
refcode = "nl_2012_hgt_female_32")
d7
# use nlreferences::transform2y() as an alternative
d8 <- new("xyz", yname = "hgt", x = seq(0, 1, 1/12), z = rep(0, 13),
usetransform = TRUE, ga = 32, sex = "female")
d8
# use nlreferences::transform2z function
d9 <- new("xyz", yname = "hgt", x = seq(0, 0.25, 1/12), y = c(43, 46, 48, 50),
usetransform = TRUE, ga = 32, sex = "female", digits = 10)
d9
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.