A bucket plot is a graphical way to check the skewness and kurtosis of a continuous variable or the residuals of a fitted GAMLSS model. It plots the transformed moment skewness and transformed moment kurtosis of the variable (or residuals) together with a cloud of points obtained using a non-parametric bootstrap from the original variable (or residuals). It also provides a graphical way of performing the Jarque-Bera test (JarqueandBera,1980).
There are two different bucket plots specified by the type
argument:
i) the moment
bucket and
ii) the centile
bucket wjhich itself can be cental
or tail
one.
bp(obj = NULL, weights = NULL,
type = c("moment", "centile.central", "centile.tail"),
xvar = NULL, bootstrap = TRUE, no.bootstrap = 99,
col.bootstrap = c("lightblue", "pink", "khaki",
"thistle", "tan", "sienna1","steelblue", "coral", "gold",
"cyan"),
pch.bootstrap = rep(21, 10), asCharacter = TRUE,
col.point = rep("black", 10), pch.point = 1:10,
lwd.point = 2, text.to.show = NULL, cex.text = 1.5,
col.text = "black", show.legend = FALSE, n.inter = 4,
xcut.points = NULL, overlap = 0, show.given = TRUE,
cex = 1, pch = 21, data = NULL,
bar.bg = c(num = "lightblue", fac = "pink"), ...)
A gamlss
fitted object.
prior weights.
type of bucket plot whether "moment", "centile.central", or "centile.tail".
the x-variable if need to split the bucket plot.
whether to bootstrap the skewness and kurtosis points
the number of the bootstrap samples in the plot
the colour of the bootstrap samples in the plot
the character plotting sympol.
whether to plot the skewness and kurtosis as character or just points.
the colout of the point is plotted as point
the character symbol for the point
the width of the symbol
whether to show character for the model
the cex
of the text
the colour
of the text
whether to show the legend
number of intervals
cut points for the xvar
if need
whether the interval id xvar
is set should ovelap
showing the top part of the plot
the cex
the point character pch
if data has to be set
the backgroud color of the bars in the top of the figure
other arguments
A plot displaying the transformed moment skewness and transformed moment kurtosis of the sample or residual of a model.
De Bastiani, F., Stasinopoulos, D. M., Rigby, R. A., Heller, G. Z., and Lucas A. (2022) Bucket Plot: A Visual Tool for Skewness and Kurtosis Comparisons. send for publication.
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.
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. 10.1201/9780429298547 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, 10.18637/jss.v023.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. 10.1201/b21973
Stasinopoulos, M. D., Rigby, R. A., and De Bastiani F., (2018) GAMLSS: a distributional regression approach, Statistical Modelling, Vol. 18, pp, 248-273, SAGE Publications Sage India: New Delhi, India. 10.1177/1471082X18759144
(see also https://www.gamlss.com/).
# NOT RUN {
m1 <- gamlss(R~pb(Fl)+pb(A), data=rent, family=GA)
bp(m1)
# }
Run the code above in your browser using DataLab