I want to compare 4 confidence intervals. I have an example for doing it with 2 intervals, but cannot make it work with 4 side by side.
Here is the working script for 2 intervals.
The VMP0$LOAD
is my data.
CIA <- t.test(VMP0$NLoad)$conf.int
CIB <- t.test(VMP1$NLoad)$conf.int
#CIC <- t.test(VMP2$NLoad)$conf.int
#CID <- t.test(VMP3$NLoad)$conf.int
lower <- c(CIA[1], CIB[1])
upper <- c(CIA[2], CIB[2])
library(gplots)
barplot2(c(mean(VMP0$NLoad), mean(VMP1$NLoad)),
plot.ci = TRUE, ci.l = lower,
ci.u = upper,col = 2:3)