Calculates the standard error of the mean statistic, an estimate of the variability of the sampling distribution of the mean. See "details" for equation.

sem(x, na.rm = FALSE)

Arguments

x

A numeric or logical atomic vector

na.rm

a logical value indicating whether NA values should be removed from the input.

Value

A scalar numeric vector

Details

Uses the following forumula:

$$S.E.M. = \sqrt{\frac{Var(x)}{N}}$$

Examples

x <- runif(30, 5, 2)
#> Warning: NAs produced
sem(x)
#> Warning: Contains missing values (element 1)
#> [1] NA