Skip to content

Instantly share code, notes, and snippets.

@gomesfellipe
Last active February 24, 2018 22:19
Show Gist options
  • Save gomesfellipe/2526939d20d33ba4fb8edf967dac530b to your computer and use it in GitHub Desktop.
Save gomesfellipe/2526939d20d33ba4fb8edf967dac530b to your computer and use it in GitHub Desktop.
Intervalo de confiança para normal variância desconhecida
# Fonte: http://www.leg.ufpr.br/Rpira/Rpira/node11.html
ic.m <- function(x, conf = 0.95){
n <- length(x)
media <- mean(x)
variancia <- var(x)
quantis <- qt(c((1-conf)/2, 1 - (1-conf)/2), df = n-1)
ic <- media + quantis * sqrt(variancia/n)
return(ic)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment