data(islands) bhist(islands,10) bhist.merge(islands,10) x <- -1/sqrt(islands) bhist(x,10) bhist.merge(x,10,4)
Confidence intervals can be checked by making simulations:
x <- rnorm(1e5) m <- 0 se <- 1 low <- x - se high <- x + se sum((lowThe answer is 68% as required. Now for the binomial case:m))/length(x)
n <- 100 p <- 0.3 nx <- rbinom(1e5,n,p) q <- (nx+1)/(n+2) se <- sqrt(q*(1-q)/n)*exp(-1/6/nx) low <- q - se high <- q + se sum((lowThe answer is slightly less than 68%, because the sampling distribution is binomial, not normal.p))/length(nx)