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

se

Computes standard error of the mean.


Description

Computes the standard error of the mean (i.e., standard deviation divided by the square root of the sample size).

Usage

se(x, na.rm = TRUE)

Arguments

x

A numeric vector.

na.rm

A logical that indicates whether missing values should be removed before computing the standard error.

Value

A single numeric that is the standard error of the mean of x.

Author(s)

Derek H. Ogle, derek@derekogle.com

See Also

See se in sciplot for similar functionality.

Examples

x <- 1:20
sd(x)/sqrt(length(x))
se(x)

# all return NA if missing values are not removed
x2 <- c(x,NA)
sd(x2)/sqrt(length(x2))

# Better if missing values are removed
se(x2,na.rm=FALSE)
sd(x2,na.rm=TRUE)/sqrt(length(x2[complete.cases(x2)]))
se(x2)

FSA

Simple Fisheries Stock Assessment Methods

v0.8.32
GPL (>= 2)
Authors
Derek Ogle [aut, cre] (<https://orcid.org/0000-0002-0370-9299>), Powell Wheeler [aut], Alexis Dinno [aut] (Provided base functionality of dunnTest())
Initial release
2021-1-15

We don't support your browser anymore

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