Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stdev

Standard Deviation


Description

stdev computes the standard deviation of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds. If x is a matrix or a data frame, a vector of the standard deviation of the columns is returned. If unbiased is TRUE then the sample standard deviation is returned, else the population standard deviation is returned.

Usage

stdev(x, na.rm, unbiased)

Arguments

x

a numeric vector, matrix or data frame

na.rm

logical value indicating if missing values should be removed.

unbiased

whether to return biased or unbiased standard deviation

Value

Standard deviation of x.

Author(s)

Knut M. Wittkowski kmw@rockefeller.edu

See Also

Examples

x <- c(1, 4, NA, 0, 5)
stdev(x, na.rm=TRUE, unbiased=TRUE)
# [1] 2.380476
stdev(x, na.rm=TRUE, unbiased=FALSE)
# [1] 1.904381

muStat

Prentice Rank Sum Test and McNemar Test

v1.7.0
GPL (>= 2)
Authors
Knut M. Wittkowski <kmw@rockefeller.edu> and Tingting Song <ttsong@gmail.com>
Initial release
2010-09-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.