Skip to content

Instantly share code, notes, and snippets.

@willium
Created November 14, 2015 09:42
Show Gist options
  • Save willium/e2f7713ad0415aaa5241 to your computer and use it in GitHub Desktop.
Save willium/e2f7713ad0415aaa5241 to your computer and use it in GitHub Desktop.
Population variance and standard deviation in R
pop.var <- function(x) var(x) * (length(x)-1) / length(x)
pop.sd <- function(x) sqrt(pop.var(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment