detail: Descriptive Statistics Table

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Provide up to fourteen statistics of an entire object. It computes: number of observations, mean, standard deviation, variance, standard error, median, mad (median absolute deviation), trimmed and winsorized means, range, minimum, maximum, skewness, and kurtosis.

Usage

1
detail(x, basic = FALSE, na.rm = TRUE, trim = 0.2, type = 2, k = 1)

Arguments

x

A vector or a data frame.

basic

A logical value indicating whether only a short version of the descriptive table might be returned.

na.rm

A logical value indicating whether NA values should be stripped before the computations.

trim

Is the proportion of the data to be replaced for estimating the average.

type

A numeric value (fraction) to be trimmed. The value in trim will be discarded from the top and bottom of data. See in details below.

k

A numeric value for observations in the data set to be discarded while computing the winsorized mean. See details below.

Details

Trimming is not Winsorizing, which is more complex than simply excluding data. In a trimmed estimator, the extreme values are discarded; in a Winsorized estimator, the extreme values are instead replaced by certain percentiles (the trimmed minimum and maximum)

Value

A data frame containing the require computations.

Note

This function provides an alternative to the existing functions in packages, such as Hmisc:describe, Zelig:describe, and psych:describe. The advantage of this approach is such that we can specify whether the returning object will be a basic or a full range of descriptive statistics.

Author(s)

Daniel Marcelino

References

Agresti, A., and Finlay, B. (1997) Statistical methods for the social sciences.

Dixon, W. J., and Yuen, K. K. (1960) Simplified Estimation from Censored Normal Samples, The Annals of Mathematical Statistics, 31, 385–391.

Dixon, W. J., and Yuen, K. K. (1999) Trimming and winsorization: A review. The American Statistician, 53(3), 267–269.

Peter J. Huber (2002) John W. Tukey's Contributions to Robust Statistics. The Annals of Statistics, 30(6), 1640–1648.

Tukey, J. W. (1962) The Future of Data Analysis. The Annals of Mathematical Statistics, 33, p. 18.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer.

See Also

cgreene76.

Examples

1
2
3
4
5
data(cgreene76) #load some data

 # To apply the function
 
detail(cgreene76, trim = 0.5, k = 3)

SciencePo documentation built on May 2, 2019, 5:53 p.m.