Learn R Programming

lmf (version 1.2)

se: 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.

Value

The standard error of x is returned.

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)}}$$

See Also

var, length, sqrt

Examples

Run this code
#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))

Run the code above in your browser using DataLab