Learn R Programming

sitar (version 1.0.4)

LMSfit: Estimate LMS curves from tabulated growth reference centiles

Description

A function to summarise an existing set of growth reference centiles as the L, M and S curves of the LMS method.

Usage

LMSfit(x, y, sex, data = parent.frame(),
  centiles = c(3, 10, 25, 50, 75, 90, 97),
  df = c(6, 10, 8), L1 = FALSE, plot = TRUE, ...)

Arguments

x
vector of tabulated ages.
y
matrix of corresponding measurement centiles, e.g. of height or weight, with nrows = length(x) and ncols = length(centiles).
sex
two-level factor where level 1 corresponds to male and level 2 to female.
data
optional data frame containing x, y and sex.
centiles
vector of centiles corresponding to the columns of y, default c(3, 10, 25, 50, 75, 90, 97).
df
length-3 vector with the cubic smoothing spline equivalent degrees of freedom (edf) for the L, M and S curves, default c(6, 10, 8).
L1
logical constraining the L curve to 1, i.e. a Normal distribution, default FALSE.
plot
logical to plot the estimated L, M and S curves, default TRUE.
...
optional graphical parameters for the plots.

Value

  • A list with the results: [object Object],[object Object],[object Object]

Details

At each age the optimal Box-Cox power Lopt is estimated to render the centiles closest to Normal, and the corresponding median Mopt and coefficient of variation Sopt are derived. The three sets of values are then smoothed across age to give L, M and S.

See Also

LMS2z, z2cent. The LMS method can be fitted to data using the package gamlss with the BCCG family, where nu (originally lambda), mu and sigma correspond to L, M and S respectively.

Examples

Run this code
## first construct table of boys weight centiles by age for WHO standard
data(who06)
zs <- -4:4*2/3 # z-scores for centiles
ages <- 0:12/4 # ages 0-3 years by 3 months
v <- LMS2z(ages, zs, sex = 1, measure = 'wt', ref = 'who06', toz = FALSE)
round(v, 2)

## then back-calculate the original LMS curves
lms <- LMSfit(x=ages, y=v, sex=1, centiles=pnorm(zs)*100, plot=FALSE)

Run the code above in your browser using DataLab