Description Usage Arguments Details Value See Also Examples
These functions are useful for producing reference tables or plots. centilesLMS
produces a table of centiles. getLMS
produces a table of interpolated LMS values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | getLMS(
x,
sex,
LMS,
xname = "x",
method = c("fmm", "periodic", "natural", "monoH.FC", "hyman", "linear", "constant"),
rule = 1
)
centilesLMS(
x,
sex,
LMS,
cent = c(0.02, 0.05, 0.25, 0.5, 0.75, 0.95, 0.98),
xname = "x",
method = c("fmm", "periodic", "natural", "monoH.FC", "hyman", "linear", "constant"),
rule = 1
)
|
x |
a single value or vector of either ages in years or height in cm at which to interpolate LMS of centile values. |
sex |
a single value or vector of sexes. Sex must be coded for males/females as 1/0, 1/2, 'm'/'f', 'M'/'F', 'Male'/'Female', or 'male'/'female'. |
LMS |
a data frame containing the LMS table with columns named "Sex","Age","Lambda","Mu", "Sigma" or "Sex","Height","Lambda","Mu","Sigma". Internal LMS tables can be referenced by |
xname |
optional name to give the x column in the output, typically "Age" or "Height". |
method |
the interpolation method. If it is "fmm", "periodic", "natural", "monoH.FC", or "hyman", |
rule |
an integer (of length 1 or 2) describing how interpolation is to take place outside the interval [min(x), max(x)]. If |
cent |
a single value or vector of centiles |
getLMS
produces a table of LMS values interpolated at the specified x values. Interpolation is done using either splinefun
or approxfun
, as determined by the method
parameter. By default, observations outside the range of the reference LMS are returned as NA
, but this can be overridden to allow for extrapolation by setting the rule
parameter. See approxfun
. centilesLMS
uses getLMS
to produce the appropriate LMS tabel, and then calculates the values at the centiles specified by cent
Returns a data frame with columns corresponding to the provided x-value and columns for either Lambda, Mu, and Sigma (for getLMS
), or the requested centiles (for centilesLMS
).
1 2 3 4 5 | #Produce a Tsimane height LMS table for males at ages 0-10
LMS<-getLMS(0:10,"Male",Tsimane.Height,xname="Age")
#Produce a Tsimane height centile table for males at ages 0-10
cent<-centilesLMS(0:10,"Male",Tsimane.Height,cent=c(0.025,0.5,0.975),xname="Age")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.