Description Usage Arguments Details Value Warning Author(s) References See Also Examples
This function centiles()
plots centiles curves for distributions belonging to the GAMLSS family of distributions.
The function also tabulates the sample percentages below each centile curve (for comparison with the model percentages given by the argument cent
.)
The function centiles.fan()
plots a fanchart of the centile curves.
A restriction of the functions is that it applies to models with one explanatory variable only.
1 2 3 4 5 6 7 8 9 10 11 12  centiles(obj, xvar, cent = c(0.4, 2, 10, 25, 50, 75, 90, 98, 99.6),
legend = TRUE, ylab = "y", xlab = "x", main = NULL,
main.gsub = "@", xleg = min(xvar), yleg = max(obj$y),
xlim = range(xvar), ylim = range(obj$y), save = FALSE,
plot = TRUE, points = TRUE, pch = 15, cex = 0.5, col = gray(0.7),
col.centiles = 1:length(cent) + 2, lty.centiles = 1, lwd.centiles = 1, ...)
centiles.fan(obj, xvar, cent = c(0.4, 2, 10, 25, 50, 75, 90, 98, 99.6),
ylab = "y", xlab = "x", main = NULL, main.gsub = "@",
xleg = min(xvar), yleg = max(obj$y), xlim = range(xvar),
ylim = range(obj$y), points = FALSE, median = TRUE, pch = 15,
cex = 0.5, col = gray(0.7),
colors = c("cm", "gray", "rainbow", "heat", "terrain", "topo"), ...)

obj 
a fitted gamlss object from fitting a gamlss distribution 
xvar 
the unique explanatory variable 
cent 
a vector with elements the % centile values for which the centile curves have to be evaluated 
legend 
whether a legend is required in the plot or not, the default is 
ylab 
the yvariable label 
xlab 
the xvariable label 
main 
the main title here as character. If NULL the default title "centile curves using NO" (or the relevant distributions name) is shown 
main.gsub 
if the 
xleg 
position of the legend in the xaxis 
yleg 
position of the legend in the yaxis 
xlim 
the limits of the xaxis 
ylim 
the limits of the yaxis 
save 
whether to save the sample percentages or not with default equal to 
plot 
whether to plot the centiles. This option is useful for 
pch 
the character to be used as the default in plotting points see 
cex 
size of character see 
col 
plotting colour see 
col.centiles 
Plotting colours for the centile curves 
lty.centiles 
line type for the centile curves 
lwd.centiles 
The line width for the centile curves 
colors 
the different colour schemes to be used for the fanchart. The following are available

points 
whether the data points should be plotted, default is 
median 
whether the median should be plotted (only in 
... 
for extra arguments 
Centiles are calculated using the fitted values in obj
and xvar
must
correspond exactly to the predictor in obj
to plot correctly.
col.centiles
, lty.centiles
and lwd.centiles
may be vector arguments
and are recycled to the length cent
if necessary.
A centile plot is produced and the sample centiles below each centile curve are printed (or saved)
This function is appropriate only when one continuous explanatory variable is fitted in the model
Mikis Stasinopoulos d.stasinopoulos@londonmet.ac.uk, Bob Rigby r.rigby@londonmet.ac.uk with contribution from Steve Ellison
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507554.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.
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, https://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 https://www.gamlss.com/).
gamlss
, centiles.split
, centiles.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  data(abdom)
h<gamlss(y~pb(x), sigma.formula=~pb(x), family=BCT, data=abdom)
# default plot
centiles(h,xvar=abdom$x)
# control of colours and lines
centiles(h, xvar=abdom$x, col.cent=c(2,3,4,5,1,5,4,3,2,1),
lwd.cent=c(1,1,1,1,2,1,1,1,1))
#Control line types
centiles(h, xvar=abdom$x, col.cent=1, cent=c(.5,2.5,50,97.5,99.5),
lty.centiles=c(3,2,1,2,3),lwd.cent=c(1,1,2,1,1))
# control of the main title
centiles(h, xvar=abdom$x, main="Abdominal data \n @")
# the fanchart
centiles.fan(h,xvar=abdom$x, colors="rainbow")
rm(h)

Loading required package: splines
Loading required package: gamlss.data
Loading required package: gamlss.dist
Loading required package: MASS
Loading required package: nlme
Loading required package: parallel
********** GAMLSS Version 5.02 **********
For more on GAMLSS look at http://www.gamlss.org/
Type gamlssNews() to see new features/changes/bug fixes.
GAMLSSRS iteration 1: Global Deviance = 4771.925
GAMLSSRS iteration 2: Global Deviance = 4771.039
GAMLSSRS iteration 3: Global Deviance = 4770.999
GAMLSSRS iteration 4: Global Deviance = 4770.994
GAMLSSRS iteration 5: Global Deviance = 4770.993
% of cases below 0.4 centile is 0.3278689
% of cases below 2 centile is 2.459016
% of cases below 10 centile is 8.688525
% of cases below 25 centile is 26.22951
% of cases below 50 centile is 50.16393
% of cases below 75 centile is 73.77049
% of cases below 90 centile is 90
% of cases below 98 centile is 98.03279
% of cases below 99.6 centile is 99.67213
% of cases below 0.4 centile is 0.3278689
% of cases below 2 centile is 2.459016
% of cases below 10 centile is 8.688525
% of cases below 25 centile is 26.22951
% of cases below 50 centile is 50.16393
% of cases below 75 centile is 73.77049
% of cases below 90 centile is 90
% of cases below 98 centile is 98.03279
% of cases below 99.6 centile is 99.67213
% of cases below 0.5 centile is 0.6557377
% of cases below 2.5 centile is 2.459016
% of cases below 50 centile is 50.16393
% of cases below 97.5 centile is 97.70492
% of cases below 99.5 centile is 99.5082
% of cases below 0.4 centile is 0.3278689
% of cases below 2 centile is 2.459016
% of cases below 10 centile is 8.688525
% of cases below 25 centile is 26.22951
% of cases below 50 centile is 50.16393
% of cases below 75 centile is 73.77049
% of cases below 90 centile is 90
% of cases below 98 centile is 98.03279
% of cases below 99.6 centile is 99.67213
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.