se {lmf}R Documentation

Standard error

Description

Calculates the standard error of the values in x

Usage

se(x, na.rm = FALSE)

Arguments

x

a numeric vector.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Details

The standard error of a length one vector is NA and if x is not a vector an error will be printed.

The standard error is defined as:

SE = \sqrt{\frac{var(x)}{length(x)}}

Value

The standard error of x is returned.

Author(s)

Thomas Kvalnes

See Also

var, length, sqrt

Examples

#The standard error of samples with the same mean and standard deviation, but
  #of different sizes.
se(rnorm(n = 10, mean = 5, sd = 1))
se(rnorm(n = 100, mean = 5, sd = 1))
se(rnorm(n = 1000, mean = 5, sd = 1))
se(rnorm(n = 10000, mean = 5, sd = 1))

[Package lmf version 1.2.1 Index]