Learn R Programming

SciencesPo (version 0.3.8.27)

detail: Descriptive Statistics Table

Description

This function provides up to fourteen statistics from 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

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.

Value

  • A data frame containing the require computations.

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)

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

Run this code
data(cgreene76) #load some data

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

Run the code above in your browser using DataLab