View source: R/S05_Statistics.R
sem | R Documentation |
This function calculates the standard error of the mean for a set of numeric values.
sem(x, na.rm = TRUE)
x |
A numeric vector. |
na.rm |
Logical; if |
Given the standard deviation s_x
and sample size
n
of a sample x
, the standard error of the mean is:
\frac{s_x}{\sqrt{n}}.
The standard error of the mean.
# Simulate 100 values from a normal distribution
set.seed(2)
x <- rnorm(100)
# Standard error of the mean should be ~0.1
sem(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.