bp | R Documentation |
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 which itself can be central
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"), ...)
obj |
A |
weights |
prior weights. |
type |
type of bucket plot whether "moment", "centile.central", or "centile.tail". |
xvar |
the x-variable if need to split the bucket plot. |
bootstrap |
whether to bootstrap the skewness and kurtosis points |
no.bootstrap |
the number of the bootstrap samples in the plot |
col.bootstrap |
the colour of the bootstrap samples in the plot |
pch.bootstrap |
the character plotting symbol. |
asCharacter |
whether to plot the skewness and kurtosis as character or just points. |
col.point |
the colout of the point is plotted as point |
pch.point |
the character symbol for the point |
lwd.point |
the width of the symbol |
text.to.show |
whether to show character for the model |
cex.text |
the |
col.text |
the |
show.legend |
whether to show the legend |
n.inter |
number of intervals |
xcut.points |
cut points for the |
overlap |
whether the interval id |
show.given |
showing the top part of the plot |
cex |
the |
pch |
the point character |
data |
if data has to be set |
bar.bg |
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.
The bucket plot provides an additional residual diagnostic tool that can be used for fitted model checking, alongside other diagnostic tools, for example worm plots, and Q (and Z) statistics.
Mikis Stasinopoulos, Bob Rigby and Fernanda De Bastiani
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("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, \Sexpr[results=rd]{tools:::Rd_expr_doi("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. \Sexpr[results=rd]{tools:::Rd_expr_doi("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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/1471082X18759144")}
(see also https://www.gamlss.com/).
wp, Q.stats
m1 <- gamlss(R~pb(Fl)+pb(A), data=rent, family=GA)
bp(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.