diff --git a/R/sem.R b/R/sem.R new file mode 100644 index 0000000..795ec06 --- /dev/null +++ b/R/sem.R @@ -0,0 +1,4 @@ +sem <- function(x, na.rm=F){ + sem<-sd(x, na.rm = na.rm)/sqrt(length(x)) + return(sem) +} diff --git a/man/sem.Rd b/man/sem.Rd new file mode 100644 index 0000000..862871b --- /dev/null +++ b/man/sem.Rd @@ -0,0 +1,17 @@ +\name{sem} +\alias{sem} +\title{sem} +\usage{ +sem(x, na.rm=T) +} +\arguments{ + \item{x}{A numeric vector or an R object but not a factor coercible to numeric by as.double(x).} + \item{na.rm}{A logical value indicating whether NA values should be stripped before the computation proceeds.} +} +\description{ +This function computes the Standard Error of the Mean of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds. +} +\examples{ +v<-rnorm(10) +sem(v) +}