Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a <- runif(1000, 8, 10) # A deliveries
- b <- runif(1000, 9, 11) # B deliveries
- # [1] 9.485513 8.665070 8.488481 8.840332 8.755384 9.448949 # A deliveries for example
- prob <- sum(b < a)/1000
- #[1] 0.112 # almost 1/8
- plot(a, b)
- polygon(c(9, 10, 10, 9),
- c(9, 9, 10, 9), density = 10, angle = 135)
- se <- sqrt(prob * (1 - prob) / 1000)
- #[1] 0.009972763
- prob - 1.96*se
- #[1] 0.09245338 lower bound
- prob + 1.96*se
- #[1] 0.1315466 upper bound
Add Comment
Please, Sign In to add comment