Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set.seed(42)
- incumbant <- c(7.3, 8.4, 8.4, 8.5, 8.7, 9.1, 9.8, 11.0, 11.1, 11.9)
- proposed <- c(17.3, 17.9, 19.2, 20.3, 20.5, 20.6, 21.1, 21.2, 21.3, 21.7)
- mean(proposed) / mean(incumbant)
- for (i in 1:M) {
- rs[i] <- mean(sample(proposed, replace=T)) - 2 * mean(sample(incumbant, replace=T))
- }
- ci.hall <- 2 * (mean(proposed)-2*mean(incumbant)) - rev(quantile(rs,prob=c(0.05, 0.95)))
- names(ci.hall) <- rev(names(ci.hall))
- ci.hall
- 5% 95%
- -0.29 2.95
- sum(rs>=0)/M
- [1] 0.8915
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement