Conducting exact binomial tests

To perform parametric testing, one must assume that the data follows a specific distribution. However, in most cases, we do not know how the data is distributed. Thus, we can perform a nonparametric (that is, distribution-free) test instead. In the following recipes, we will show you how to perform nonparametric tests in R. First, we will cover how to conduct an exact binomial test in R.

Getting ready

In this recipe, we will use the binom.test function from the stat package.

How to do it…

Perform the following steps to conduct an exact binomial test:

  1. Let's assume there is a game where a gambler can win by rolling the number six on a dice. As part of the rules, the gambler can bring their own dice. If the gambler tried ...

Get R for Data Science Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.