postscript(file="ci.ps", horizontal = F, font=3, pointsize=14) par(mfrow=c(1,1), pty="s") p <- seq(0,1,by=0.01) hp <- pbinom(2, 18, p) plot(p, hp, ylab="h(p)", type="l") title("h(p) = P[X <= 2] or h(p) = P[X <= 1] for X ~ Bin(18, p)", cex=0.9) segments(0.3102627, -0.05, 0.3102627, 0.05) segments(-0.04, 0.05, 0.3102627, 0.05) hp <- pbinom(1, 18, p) lines(p, hp, lty=2) segments(0.02011, -0.05, 0.02011, 0.95) segments(-0.04, 0.95, 0.02011, 0.95) legend(0.4, 0.9, lty=c(1,2), c("P[X<=2]", "P[X<=1]"), cex=0.9) dev.off()