author: dguedo date: Feb 27th, 2016
I developed an educational data product used to illustrate the Central limit theorem, by repeatedly taking the mean from a set of independent and identically distributed random variables and plotting the results. This application was developed for the Developing Data Products course.Users of the application can manipulate the application three different ways by;
- Controlling the size of IID sets
- Increasing or decreasing the number of sample mean observations
- Changing the size of bins for the histogram
This is achieved by first finding the mean for a set of IID random variables, then repeating this process a number of times. The code below executes this algorithm, with inputs from the user.
# server.R
means <- data.frame(
x=sapply(1:input$n_simulations,
function(x)
{mean(rnorm(input$n_size))}))
- You can find the application here: https://dguedo.shinyapps.io/Shiny_Application/
- The code can be found on github here: https://github.com/dguedo/Shiny_Application