Learn R Programming

guf (version 1.0.2)

se: Standard Error

Description

The Standard Error (`se`) of a numerical vector x.

Usage

se(x, na.rm = TRUE)

Arguments

x

A vector of numerical values, be it integers and/or real numbers.

na.rm

A Boolean, indicating whether NAs need to be removed from x before calculating the Standard Error; defaults to TRUE

Value

One real number, being the Standard Error.

Examples

Run this code
# NOT RUN {
my_vector = c(1, 3, 4, 7.5, 8)
var(my_vector); sd(my_vector); se(my_vector)
my_vector = c(NA, 3, 4, 7.5, 8)
var(my_vector); sd(my_vector); se(my_vector)
# note that se() by default leaves out NAs. But compare:
var(my_vector); sd(my_vector); se(my_vector, na.rm=FALSE)
# }

Run the code above in your browser using DataLab