Standard Error in R (Example)

On this page, I’ll explain how to calculate the standard error in the R programming language.

Example Data

We use the following numeric vector as example data:

x <- c(6, 8, 4, 3, 9, 3, 5, 1, 3, 2, 5, 2)    # Create example vector

Example: Computation of Standard Error in R

We can compute the standard error with a combination of the sd, sqrt and length functions:

sd(x) / sqrt(length(x))                       # Compute standard error
# 0.7084447

The standard error of our example data is 0.7084447.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top