# NOT RUN {
# plot means and
data(state)
tmp <- split(state.area, state.region)
means <- sapply(tmp, mean)
stdev <- sqrt(sapply(tmp, var))
n <- sapply(tmp,length)
ciw <- qt(0.975, n) * stdev / sqrt(n)
# plain
plotCI(x=means, uiw=ciw)
# prettier
plotCI(x=means, uiw=ciw, col="black", barcol="blue", lwd=1)
# give mean values
plotCI(x=means, uiw=ciw, col="black", barcol="blue",
labels=round(means,-3), xaxt="n", xlim=c(0,5) )
axis(side=1, at=1:4, labels=names(tmp), cex=0.7)
# better yet, just use plotmeans ... #
plotmeans( state.area ~ state.region )
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab