centiles.Inf0to1 {gamlss.inf} | R Documentation |
Plotting centile curves for a gamlssInf0to1
and gamlssZadj
object
Description
Function centiles.Inf0to1()
plots centile curves for distributions belonging to the GAMLSS family of distributions defined in the intervals (0,1],[0,1) and [0,1].
The function also tabulates the sample percentages below each centile curve (for comparison with the model percentages given by the argument cent
).
A restriction of the function is that it applies to models with one explanatory variable only.
Usage
centiles.Inf0to1(obj, xvar = NULL, 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.Zadj(obj, xvar = NULL, 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, ...)
Arguments
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 y-variable label |
xlab |
the x-variable 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 x-axis |
yleg |
position of the legend in the y-axis |
xlim |
the limits of the x-axis |
ylim |
the limits of the y-axis |
save |
whether to save the sample percentages or not with default equal to |
plot |
whether to plot the centiles |
points |
whether the data points should be plotted, default is |
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 |
... |
for extra arguments |
Details
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.
Value
A centile plot is produced and the sample centiles below each centile curve are printed (or saved)
Warning
This function is appropriate only when one continuous explanatory variable is fitted in the model
Author(s)
Mikis Stasinopoulos mikis.stasinopoulos@gamlss.org, Bob Rigby r.rigby@londonmet.ac.uk with contribution from Steve Ellison
References
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. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).
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.
Houssain, A., Stasinopoulos, M., Rigby, R. and Enea, M. (2015). Centile estimation for a proportion response variable. Accepted for publication on Statistics in Medicine.
See Also
gamlssInf0to1
, gamlss
, centiles.split
, centiles.com
Examples
## Not run:
gen.Family("SST", "logit")
gen.Inf0to1("logitSST","One")
set.seed(30)
x <- seq(0,1,l=2000)
dat <- data.frame(x)
dat$Y <- rlogitSSTInf1(2000,mu=-3+10*x-0.7*x^2,sigma=0.9,nu=0.5,
tau=5,xi1=plogis(-0.5*ifelse(x>0.7,-1,13)),log=FALSE)
m1 <- gamlssInf0to1(y=Y,mu.formula=~pb(x), sigma.formula=~pb(x),
nu.formula=~pb(x), tau.formula=~pb(x),
xi1.formula=~pb(x),
data=dat, family=logitSST)
centiles.Inf0to1(m1,xvar= dat$x, cent=c(2,10,25,50,75,90,98),
col.centiles=c(1,7:2),
ylab="proportion", xlab="x",legend=FALSE,main="(c) Inf. logitSST")
## End(Not run)