Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.61 KB | None | 0 0
  1. teoremaCentralLimite.chisq=function(n, N=1000, titulo="Histograma chisq(1000,1)", yl=c(0, .4)) { ## início da função
  2. medias=numeric(N)
  3. for (i in 1:N) medias[i]= mean(rchisq(n,1/3))
  4. hist(medias, xlim=c(-1,10), ylim=yl, freq=F, main=titulo)
  5. x=seq(-1,10, .02)
  6. points(x, dnorm(x, 3, 3*sqrt(1/n) ), type="l", lwd=3)
  7. } ## fim da função
  8. graphics.off()
  9. par(mfrow=c(3,3), mai=c(.3,.4,.1,.1))
  10. teoremaCentralLimite.chisq(5,titulo="n=5")
  11. teoremaCentralLimite.chisq(15,titulo="n=15")
  12. teoremaCentralLimite.chisq(25,titulo="n=25")
  13. teoremaCentralLimite.chisq(100,titulo="n=100")
  14. teoremaCentralLimite.chisq(1000,titulo="n=1000")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement