MeanSE: Standard Error of Mean

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculates the standard error of mean.

Usage

1
MeanSE(x, sd = NULL, na.rm = FALSE)

Arguments

x

a (non-empty) numeric vector of data values.

sd

the standard deviation of x. If provided it's interpreted as sd of the population. If left to NULL (default) the sample sd(x) will be used.

na.rm

logical. Should missing values be removed? Defaults to FALSE.

Details

MeanSE calculates the standard error of the mean defined as:

\frac{σ}{√{n}}

σ being standard deviation of x and n the length of x.

Value

the standard error as numeric value.

Author(s)

Andri Signorell <andri@signorell.net>

See Also

MeanCI

Examples

1
2
3
4
5
6
data(d.pizza)

MeanSE(d.pizza$price, na.rm=TRUE)

# evaluate data.frame
sapply(d.pizza[,1:4], MeanSE, na.rm=TRUE)

Example output

[1] 0.6252242
      index        date        week     weekday 
10.04158022  0.26218843  0.03873807  0.05886462 

DescTools documentation built on June 17, 2021, 5:12 p.m.