std_error | R Documentation |
Calculate standard error of the mean
std_error(x)
x |
name of a column in a data.frame/data.table or a vector |
numeric
plotrix R package July 11, 2022: https://github.com/plotrix/plotrix/blob/master/R/std_error.R.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.