The functions momentSK()
, centileSK()
, centileSkew()
and centileKurt()
, calculate sample statistics related to skewness and kurtosis. The function theoCentileSK()
calculates the theoretical centile statistics from a given gamlss.family
distribution. The plotCentileSK()
plots the theoretical centile skewness and kurtosis against p
(see below).
The function checkMomentSK()
can be use to check (a) whether the moment skewness and kurtosis of a fitted model are modelled adequantly (the residuals of the model are used). (b) whether a given sample display skewness or kurtosis.
momentSK(x, weights=NULL)
centileSK(x, cent = c(1, 25), weights=NULL)
centileSkew(x, cent = 1, weights=NULL)
centileKurt(x, cent = 1, weights=NULL)theoCentileSK(fam = "NO", p = 0.01, ...)
plotCentileSK(fam = "NO", plotting = c("skew", "kurt", "standKurt"),
add = FALSE, col = 1, lty = 1, lwd = 1, ylim = NULL, ...)
checkMomentSK(x, weights=NULL, add = FALSE, bootstrap = TRUE, no.bootstrap = 99,
col.bootstrap = "lightblue", pch.bootstrap = 21,
asCharacter = TRUE, col.point = "black", pch.point = 4,
lwd.point = 2, text.to.show = NULL, cex.text = 1.5,
col.text = "black", show.legend = TRUE)
checkCentileSK(x,weights=NULL, type = c("central", "tail"), add = FALSE,
bootstrap = TRUE, no.bootstrap = 99,
col.bootstrap = "lightblue", pch.bootstrap = 21,
asCharacter = TRUE, col.point = "black", pch.point = 4,
lwd.point = 2, text.to.show = NULL, cex.text = 1.5,
col.text = "black", show.legend = TRUE)
Different functions produce different output:
The function momentSK()
produce:
sample moment skewness
sample transformed moment skewness
sample moment kurtosis
sample excess moment kurtosis
sample ransformed moment excess kurtosis
the value of the Jarque-bera test for testing whether skewness and excess kurtosis are zero or not
The function centileSK()
produces:
sample centile central skewness
sample centile tail skewness
sample centile kurtosis
standardised centile kurtosis, (K0.01/3.449
)
excess centile kurtosis, (K0.01-3.449
)
transfored excess centile kurtosis, (exc.K0.01/(1+abs(exc.K0.01))
The function centileSkew()
for a given argument p
produces:
the value determiming the centile skewness
sample centile skewness at p
The function centileKurt()
for a given argument p
produces:
the value determiming the centile kurtosis
sample centile kurtosis at p
sample standardised centile kurtosis at p
sample excess centile kurtosis at p
sample transformed excess centile kurtosis at p
The function theoCentileSK
for a given gamlss.family
produces:
the interquartile range of the distribution
the semi interquartile range of the distribution
the central skewness of the distribution
the tail skewness of the distribution
the centile kurtosis of the distribution
the standardised centile kurtosis of the distribution
data vector or gamlss model
prior weights for the x
the centile required
For centile skewness and kurtosis only whether "central" (default) or "tail")
A gamlss distribution family
what to plot
whether to add the line to the existing plot
the colour of the line
the type of the line
the width of the line
the y limit of the graph
the value determiming the centile skewness or kurtosis
additional arguments pass to theoCentileSK()
function i.e. the values of the distribution parameters
whether a plot of the bootstrap skewness and kurtosis measures should be added in the plot
the number of boostrap skewness and kurtosis measures
the coloue for boostraps
the point type of boostraps
whether to plot the estimated skewness and kurtosis measure as character or as point
the colour of the skewness and kurtosis measure
the point type of the skewness and kurtosis measure
the width of the plotted point
to display text different from variable or model
the size of the text
the colour of the text
whether to show the legent
Mikis Stasinopoulos, Bobert Rigby, Gillain Heller and Fernanda De Bastiani.
Those function calculate sample moment and centile skewness and kurtosis statistics and theoretical centile values for a specific distribution.
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, 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, 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. tools:::Rd_expr_doi("10.1201/b21973")
(see also https://www.gamlss.com/).
gamlss.family
Y <- rSEP3(1000)
momentSK(Y)
centileSK(Y)
centileSkew(Y, cent=20)
centileKurt(Y, cent=30)
theoCentileSK("BCCG", mu=2, sigma=.2, nu=2)
plotCentileSK(fam="BCCG", mu=2, sigma=.2, nu=2)
# \donttest{
checkMomentSK(Y)
checkCentileSK(Y)
checkCentileSK(Y, type="tail")# }
Run the code above in your browser using DataLab