std_error: Calculate standard error of the mean

std_errorR Documentation

Calculate standard error of the mean

Description

Calculate standard error of the mean

Usage

std_error(x)

Arguments

x

name of a column in a data.frame/data.table or a vector

Value

numeric

Source

plotrix R package July 11, 2022: https://github.com/plotrix/plotrix/blob/master/R/std_error.R.

Examples


temp1 <- data.table::data.table(x = c(seq(0, 400, 100), seq(1000, 1800, 200), NA),
mygroup = c(rep("A", 5), rep("B", 6))
)
std_error(c(seq(0, 400, 100), NA)) # expected value for mygroup == A
std_error(c(seq(1000, 1800, 200), NA)) # expected value for mygroup == B
temp1[, list(sem = std_error(x)), by = 'mygroup'][] # view summary table
temp1[, sem := std_error(x), by = 'mygroup'][] # save results in the original



PHSKC-APDE/rads documentation built on April 14, 2025, 10:47 a.m.