se: Standard Error

seR Documentation

Standard Error

Description

This function computes the standard error of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds.

Usage

se(x, na.rm = FALSE)

Arguments

x

a numeric vector or an R object which is coercible to one by as.vector(x, "numeric"). Can also be a matirx or data frame, in which case, the standard error is calculated fro each column.

na.rm

logical. Should missing values be removed?

Details

Equivalent to sd divided by square root of n.

The standard error of a zero-length vector (after removal of NAs if na.rm = TRUE) is not defined and gives an error. The standard error of a length-one vector is NA.

Author(s)

Jason Grafmiller

See Also

mean, sd

Examples

x <- rnorm(100, mean = 10, sd = 5)

sd(x)/sqrt(100)

se(x)

jasongraf1/JGmisc documentation built on March 21, 2022, 7:42 a.m.