Routines to handle references constructed with the
LMS method. Given a set of LMS values, the functions convert
z-scores to measurement centiles and vice versa.
Usage
zLMS(x, L = 1, M, S)
cLMS(z, L = 1, M, S)
Arguments
x
vector of measurements to be converted to z-scores.
z
vector of z-scores to be converted to measurements.
L
vector of Box-Cox transformation (lambda) values, L in the LMS method.
M
vector of medians (mu), M in the LMS method.
S
vector of coefficients of variation (sigma), S in the LMS method.
Value
zLMS and cLMS each return a vector or matrix, respectively of z-scores
and measurement centiles, with the number of rows matching the length of
x or z, and the number of columns matching the length of L, M and S.
If the two lengths are the same, or if either length is 1, a vector is returned.
Details
L, M and S should all be the same length, recycled if necessary.
The formulae converting x to z and vice versa are:
$$z = \frac{(x/M)^L - 1}{L S}$$
$$x = M (1 + L S z)^{1/L})$$
where L is reset to 10^-7 if it is zero. x and z are usually the same length as L M and S, but can be different. The LMS method is the same as the BCCG family in
the gamlss package, except that lambda in LMS is referred to as nu in BCCG.