Learn R Programming

fitdistrplus (version 0.2-1)

descdist: Description of an empirical distribution for non-censored data

Description

Computes descriptive parameters of an empirical distribution for non-censored data and provides a skewness-kurtosis plot.

Usage

descdist(data,discrete=FALSE,boot=NULL,method="unbiased",
graph=TRUE,obs.col="red",boot.col="pink")

Arguments

data
A numeric vector.
discrete
If TRUE, the distribution is considered as discrete.
boot
If not NULL, boot values of skewness and kurtosis are plotted from bootstrap samples of data. boot must be fixed in this case to an integer above 10.
method
"unbiased" for unbiased estimated values of statistics or "sample" for sample values.
graph
If FALSE, the skewness-kurtosis graph is not plotted.
obs.col
Color used for the observed point on the skewness-kurtosis graph.
boot.col
Color used for bootstrap sample of points on the skewness-kurtosis graph.

Value

  • descdist returns a list with 7 components,
  • minthe minimum value
  • maxthe maximum value
  • medianthe median value
  • meanthe mean value
  • sdthe standard deviation sample or estimated value
  • skewnessthe skewness sample or estimated value
  • kurtosisthe kurtosis sample or estimated value

Details

Minimum, maximum, median, mean, sample sd, and sample (if method=="sample") or by default unbiased estimations of skewness and Pearsons's kurtosis values (Fisher, 1930) are printed. Be careful, estimations of skewness and kurtosis are unbiased only for normal distributions and estimated values are thus only indicative. A skewness-kurtosis plot such as the one proposed by Cullen and Frey (1999) is given for the empirical distribution. On this plot, values for common distributions are also displayed as a tools to help the choice of distributions to fit to data. For some distributions (normal, uniform, logistic, exponential for example), there is only one possible value for the skewness and the kurtosis (for a normal distribution for example, skewness = 0 and kurtosis = 3), and the distribution is thus represented by a point on the plot. For other distributions, areas of possible values are represented, consisting in lines (gamma and lognormal distributions for example), or larger areas (beta distribution for example). The Weibull distribution is not represented on the graph but it is indicated on the legend that shapes close to lognormal and gamma distributions may be obtained with this distribution. In order to take into account the uncertainty of the estimated values of kurtosis and skewness from data, the data set may be boostraped by fixing the argument boot to an integer above 10. boot values of skewness and kurtosis corresponding to the boot bootstrap samples are then computed and reported in blue color on the skewness-kurtosis plot. If discrete is TRUE, the represented distributions are the Poisson, negative binomial and normal distributions. If discrete is FALSE, these are uniform, normal, logistic, lognormal, beta and gamma distributions.

References

Cullen AC and Frey HC (1999) Probabilistic techniques in exposure assessment. Plenum Press, USA, pp. 81-159. Evans M, Hastings N and Peacock B (2000) Statistical distributions. John Wiley and Sons Inc. Fisher RA (1930) The moments of the distribution for normal samples of measures of departures from normality. Proc. R. Soc. London, Series A 130, 16-28.

See Also

plotdist

Examples

Run this code
# (1) Description of a sample from a normal distribution
# with and without uncertainty on skewness and kurtosis estimated by bootstrap 
#
x1 <- rnorm(100)
descdist(x1)
descdist(x1,boot=1000)

# (2) Description of a sample from a beta distribution
# with uncertainty on skewness and kurtosis estimated by bootstrap
# with changing of default colors 
#
descdist(rbeta(100,shape1=0.05,shape2=1),boot=1000,
obs.col="blue",boot.col="orange")

# (3) Description of a sample from a gamma distribution
# with uncertainty on skewness and kurtosis estimated by bootstrap
# without plotting 
#
descdist(rgamma(100,shape=2,rate=1),boot=1000,graph=FALSE)

# (3) Description of a sample from a Poisson distribution
# with uncertainty on skewness and kurtosis estimated by bootstrap 
#
descdist(rpois(100,lambda=2),discrete=TRUE,boot=1000)

# (4) Description of serving size data
# with uncertainty on skewness and kurtosis estimated by bootstrap 
#
data(groundbeef)
serving <- groundbeef$serving
descdist(serving, boot=1000)

Run the code above in your browser using DataLab