responses <- read.csv("BIOS 610 Spring 2019 fun survey - guess Prof Waldron's age (Responses) - Form Responses 1.csv")
responses <- responses[order(responses[, 3]), ]
par(cex=1)
plot(x=responses[, 2], y=1:nrow(responses), xlab="Age (years)", ylab="Guesser ID",
     main="Point estimates and CIs for Prof Waldron's age",
     xlim=c(min(responses[, -1]), max(responses[, -1])), ylim=c(-1, nrow(responses)+2))
segments(x0=responses[, 5], x1=responses[, 6], y0=1:nrow(responses), y1=1:nrow(responses), lw=3)  #95% CI
segments(x0=responses[, 3], x1=responses[, 4], y0=1:nrow(responses)+0.1, y1=1:nrow(responses)+0.1, col="red", lty=3, lw=3) #50% CI
legend("bottomright", legend=c("50% CI", "95% CI"), lty=c(3,1), col=c("red", "black"), lw=3, bty = "n")
CI95 <- t.test(responses[, 2], conf.level=0.95)$conf.int
CI50 <- t.test(responses[, 2], conf.level=0.5)$conf.int
segments(x0=CI95[1], x1=CI95[2], y0=nrow(responses)+1.5, y1=nrow(responses)+1.5, col="black", lw=5)
segments(x0=CI50[1], x1=CI50[2], y0=nrow(responses)+1.7, y1=nrow(responses)+1.7, col="red", lw=5, lty=1)
points(x=mean(responses[, 2]), y=nrow(responses)+1.5, col="blue", cex=2)
text(x=CI95[2], y=nrow(responses)+1.7, pos=4, labels="Calculated from point estimates")

Ratio of 95% CI to 50% CI

What is the ratio of students’ 95% interval sizes to 50% interval sizes, compared to the “correct” ratio calculated from a t distribution?

par(cex=1)
hist((abs(responses[, 6] - responses[, 5]) / (responses[, 4] - responses[, 3])),
     breaks="FD", main="Ratio of 95% CI width / 50% CI width", xlab="Ratio")
abline(v=(qt(0.975, df=nrow(responses)-1) / qt(0.75, df=nrow(responses)-1)), col="red", lw=3)
legend("topright", lty=1, col="red", lw=3, legend="Correct ratio")