ABSTRACT

This chapter presents two options for testing a single proportion. The first option is the traditional z-test, prop.test, and the second option is an exact test, binom.test. The prop.test generalizes to two or more populations. The chapter provides an example of testing two proportions by using data generated from a binomial distribution using rbinom. One can also use prop.test when testing two proportions. An exact test for two proportions can be done using fisher.test. Finally, the chapter illustrates the meaning of alpha simulation by using the prop.test. It also provides an example of the error associated with the alpha simulation.