ABSTRACT

This chapter provides two simulations to illustrate the central limit theorem. It demonstrates how to perform a z-test and calculate associated confidence intervals when working from a data set and from summary statistics. The data used for the z-test and interval are generated randomly from a normal distribution, while the data used for simulations are generated from exponential and uniform distributions. The chapter uses the BSDA package since z-test is not a base function for R. It also demonstrates that performing a z-test and calculating a confidence interval for two means is almost exactly the same as for one mean.