Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. y <- rnorm( n = 1000, m = 100, sd = 2.551 )
  2.  
  3. hist(y)
  4.  
  5. # select all of the bags weight 95 or less
  6. bags95 <- y[ y <= 95 ]
  7. # count how many of them there are
  8. length(bags95)
  9.  
  10. # let's make a function that does our experiment,
  11. # get some bags and return their mean.***
  12. getBags <- function(n){
  13. x <- rnorm(n = n, m = 100, sd = 2.551)
  14. mean(x)}
  15. # now let's get the bags
  16. y <- replicate( 1000, getBags(50) )
  17.  
  18. sd(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement