| clt.sim {NCStats} | R Documentation |
A dynamic graphic to illustrate the Central Limit Theorem. The user can change the population distribution that is sampled from and the sample size.
clt.sim(reps = 1000, incl.norm = TRUE)
reps |
Number of samples to take from the population distribution and means to calculate. |
incl.norm |
A logical indicating whether a normal density curve should be superimposed on the sampling distribution. |
This function produces two graphics. The left-most graphic is a histogram of the individuals in the population and the right-most graphic is a histogram of the simulated sampling distribution (i.e., means from the multiple samples). The right-most graphic may include a normal distribution density curve if the incl.norm argument is used.
The two graphics are dynamically controlled by three slider bars. The first two slider bars control the shape parameters of the beta distribution used to model the population distribution that will be sampled from. The beta distribution allows for a wide variety of shapes for the population distribution. The last slider bar controls the size of each sample taken from the population distribution. The slider bars can 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.
None, but a dynamic graphic with slider bars will be produced.
On first call a dialog box with three sliders will appear in the upper-left corner of the R window. A graphic will not be seen until an item in the dialog box is changed. At this time, the dialog box will appear to disappear. However, it has simply been minimized and can be reaccessed as all minimized programs are accessed. This “bug” only appears when the function is started and upon first change of an item in the dialog box.
Derek H. Ogle, dogle@northland.edu
## Not run by examples(). Copy and try in an interactive R session ## Not run: clt.sim()