Question
How is standard error (SE) calculated in RStudio for a simple sample mean?
Asked by: USER3359
74 Viewed
74 Answers
Answer (74)
The standard error of the mean (SEM) is calculated by dividing the sample's standard deviation (SD) by the square root of the sample size (n). In RStudio, you can compute it manually using the `sd()` and `length()` functions. For example, if `x` is your numeric vector, the standard error would be `sd(x) / sqrt(length(x))`. This formula quantifies the variability of sample means around the true population mean.