SciencesPo (version 1.3.8)

se: Calculates the Standard Error

Description

Compute the standard errors of a numeric vector

Usage

se(x, na.rm = TRUE)

## S3 method for class 'ANY': se(x, na.rm = TRUE)

Arguments

x
A vector of class numeric or integer
na.rm
A logical value for na.rm, default is na.rm=TRUE.

encoding

UTF-8

Details

The standard error of the mean (SEM) (assuming statistical independence of the values in the sample) is estimated by taking the standard deviation of the population sample, divided by the square root of the sample size: $$se = \frac{{s}}{{\sqrt{n}}}$$

Examples

Run this code
x <- c(1, 2.3, 2, 3, 4, 8, 12, 43, -1,-4)
myse <- sd(x)/sqrt(length(x))
myse
# With the 'se' function:
se(x)

Run the code above in your browser using DataCamp Workspace