Demonstrating Confidence Intervals with Shiny

January 6, 2013

(This article was first published on PsychoAnalytix Blog, and kindly contributed to R-bloggers)

For the introductory statistic student confidence intervals can seem a daunting concept to grasp.  Quite simply put it is an interval that we have a certain measure of confidence that the population parameter falls into.  The 95% confidence is the most common value chosen in my academic circle.  Nevertheless, many others may be viable as well as long as the decision is based on theory. It is quite easy to make the mistake of assuming that a larger sample size will reduce your likelihood of making a type 1 error (rejecting the null when you shouldn’t have).   To demonstrate this I put together a shiny app that can be found here or by clicking on the image below.  The code for this app is publicly available on github here. As you change the sample size the intervals will get smaller but the number of red line (type 1 errors) will appear roughly the same amount of time.   Special thanks to Larry Cook for introducing me to this neat plot and method for demonstrating confidence intervals.


To leave a comment for the author, please follow the link and comment on their blog: PsychoAnalytix Blog. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)