cltSim {NCStats}R Documentation

A dynamic graph to illustrate the Central Limit Theorem.


A dynamic graph to illustrate the central limit theorem (CLT). The user can change the population distribution that is sampled from and the sample size.


cltSim(reps = 5000, incl.norm = FALSE)



Number of resamples to take from the population distribution and means to calculate


A logical that indicates whether a normal density curve should be superimposed on the sampling distribution


This function produces two graphics. The left graphic is a histogram of the individuals in the population and the right graphic is a histogram of the simulated sampling distribution (i.e., means from the multiple samples). The right graphic may include a normal distribution density curve with incl.norm=TRUE.

The two graphs are dynamically controlled by three sliders. The first two sliders control the shape parameters of the beta distribution used to model the population distribution sampled from. A wide variety of shapes may be created with these two shape parameters. The third slider controls the size of each sample taken from the population distribution. The sliders may be used to detect how changes in the shape of the population and the size of the sample effect the shape, center, and dispersion of the sampling distribution.

If the user is using RStudio and the manipulate package is installed then the dynamic graph is produced in the “Plots” pane of RStudio. The plot controls may be accessed through the “gear” that is in the upper-left corner of the plot. If the user is not using RStudio or the manipulate package is not installed, then an attempt is made to produce the dynamic graph with Tcl/Tk using the functions in the relax package.


None, but a dynamic graph with sliders is produced.


## Not run: 

## End(Not run)

[Package NCStats version 0.4.7 Index]