In R, how to find the standard error of the mean?

alex picture alex · Apr 20, 2010 · Viewed 352.7k times · Source

Is there any command to find the standard error of the mean in R?

Answer

Ian Fellows picture Ian Fellows · Apr 20, 2010

The standard error is just the standard deviation divided by the square root of the sample size. So you can easily make your own function:

> std <- function(x) sd(x)/sqrt(length(x))
> std(c(1,2,3,4))
[1] 0.6454972