sd_trim: Trimmed standard deviation

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

View source: R/sd_trim.R

Description

The trimmed standard deviation as a robust estimator of scale is computed.

Usage

1
sd_trim(x,trim=0.2,const=TRUE)

Arguments

x

numeric vector, data frame or matrix

trim

trimming proportion; should be between 0 and 0.5

const

if TRUE, the appropriate consistency correction is done

Details

The trimmed standard deviation is defined as the average trimmed sum of squared deviations around the trimmed mean. A consistency factor for normal distribution is included. However, this factor is only available now for trim equal to 0.1 or 0.2. For different trimming percentages the appropriate constant needs to be used. If the input is a data matrix, the trimmed standard deviation of the columns is computed.

Value

Returns the trimmed standard deviations of the vector x, or in case of a matrix, of the columns of x.

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

sd,mean

Examples

1
2
3
x <- c(rnorm(100),100) # outlier 100 is included
sd(x) # classical standard deviation
sd_trim(x) # trimmed standard deviation

chemometrics documentation built on May 19, 2017, 7:46 a.m.

Search within the chemometrics package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.