This function is design to help the user to easily construct growth curve centile estimation. It is applicable when only "one" explanatory variable is available (usually age).
lms(y, x, families = LMS, data = NULL, k = 2,
cent = 100 * pnorm((-4:4) * 2/3),
calibration = TRUE, trans.x = FALSE,
fix.power = NULL, lim.trans = c(0, 1.5),
prof = FALSE, step = 0.1, legend = FALSE,
mu.df = NULL, sigma.df = NULL, nu.df = NULL,
tau.df = NULL, c.crit = 0.01,
method.pb = c("ML", "GAIC"), ...)
The response variable
The unique explanatory variable
a list of gamlss.families
with default LMS=c("BCCGo", "BCPEo", "BCTo")
the data frame
the penalty to be used in the GAIC
a vector with elements the % centile values for which the centile curves have to be evaluated
whether calibration is required with default TRUE
whether to check for transformation in x with default FALSE
if set it fix the power of the transformation for x
the limits for the search of the power parameter for x
whether to use the profile GAIC of the power tranformation
if codeprof=TRUE is used this determine the step for the profile GAIC
whether a legend is required in the plot with default FALSE
mu
effective degrees of freedom if required otherwise are estimated
sigma
effective degrees of freedom if required otherwise are estimated
nu
effective degrees of freedom if required otherwise are estimated
tau
effective degrees of freedom if required otherwise are estimated
the convergence critetion to be pass to gamlss()
the method used in the pb()
for estimating the smoothing
parameters. The default is local maximum likelihood "ML"
. "GAIC"
is also permitted where k
is taken from the k
argument of the function.
extra argument which can be passed to gamlss()
It returns a gamlss
fitted object
This function should be used if the construction of the centile curves involves only one explanatory variable.
The model assumes that the response variable has a flexible distribution i.e. \(y ~ D(\mu, \sigma, \nu, \tau)\) where the parameters of the distribution are smooth functions of the explanatory variable i.e. \(g(\mu)= s(x)\), where \(g()\) is a link function and \(s()\) is a smooth function. Occasionally a power transformation in the x-axis helps the construction of the centile curves. That is, in this case the parameters are modelled by \(x^p\) rather than just x, i.e.\(g(\mu)= s(x^p)\). The function lms()
uses P-splines (pb()
) as a smoother.
If a transformation is needed for x
the function lms()
starts by finding an optimum value for p
using the simple model \(NO(\mu=s(x^p))\). (Note that this value of p
is not the optimum for the final chosen model but it works well in practice.)
After fitting a Normal error model for staring values the function proceeds by fitting several "appropriate" distributions for the response variable.
The set of gamlss.family
distributions to fit is specified by the argument families
.
The default families
arguments is LMS=c("BCCGo", "BCPEo", "BCTo")
that is the LMS class of distributions, Cole and Green (1992).
Note that this class is only appropriate when y is positive (with no zeros). If the response variable contains negative values and zeros then use the argument families=theSHASH
where theSHASH <- c("NO", "SHASHo")
or add any other list of distributions which you may think is appropriate.
Justification of using the specific centile (0.38 2.27 9.1211220 25.25, 50, 74.75, 90.88, 97.72, 99.62) is given in Cole (1994).
Cole, T. J. (1994) Do growth chart centiles need a face lift? BMJ, 308--641.
Cole, T. J. and Green, P. J. (1992) Smoothing reference centile curves: the LMS method and penalized likelihood, Statist. Med. 11, 1305--1319
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.
(see also http://www.gamlss.org/).
# NOT RUN {
data(abdom)
m1 <- lms(y,x , data=abdom, n.cyc=30)
m2 <- lms(y,x ,data=abdom, method.pb="GAIC", k=log(610))
# this example takes time
data(db)
m1 <- lms(y=head, x=age, data=db, trans.x=TRUE)
# }
Run the code above in your browser using DataLab