Skip to content

Instantly share code, notes, and snippets.

@steveharoz
Last active November 26, 2015 10:52
Show Gist options
  • Save steveharoz/6a8c79fa159e3d751bef to your computer and use it in GitHub Desktop.
Save steveharoz/6a8c79fa159e3d751bef to your computer and use it in GitHub Desktop.
Standard Error for R
# r doesn't have a standard error function
stderr = function(x) sqrt(var(x,na.rm=TRUE)/length(na.omit(x)))
ci = function(x, confidence.interval=0.95) stderr(x) * qnorm(1 - (1-confidence.interval)/2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment