Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.18 KB | None | 0 0
  1. cnt = 0
  2. for (i in 1:500) {
  3.   x = rnorm(500,0,1)
  4.   y = t.test(x,conf.level = 0.9)
  5.   if(y$conf.int[1] <= 0) {
  6.     if(y$conf.int[2] >= 0){
  7.       cnt = cnt + 1
  8.     }
  9.   }
  10. }
  11. cnt/500.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement