# Chapter 4: Categorical Data and Hypothesis Testing

4.1 The multiplicative law of probability states that the probability of two (or more) events occurring simultaneously is the product of their individual probabilities. The multiplicative law pertains to those situations where *and* is the conjunction. It assumes that the events are *independent*.

First of all, the probability of all 10 tosses of a coin coming up heads depends on the probability of tossing a head. If the probability of a head on any given toss is 0.5, then the probability of 10 heads with 10 tosses is 0.5^{10} or 0.001. If the probability of a head on any given toss is 0.6, then the probability of 10 heads with 10 tosses is 0.6^{10} or 0.006. If the probability of a head on any given toss is 0.4, then the probability of 10 heads with 10tosses is 0.4^{10} or 0.0001.

4.2 You can use the binomial formula to compute the probability of answering one out of two items correctly and the probability of answering two out of two items correctly. You then can sum the two probabilities. This would give you the probability of the student having a score greater than 0. Using the binomial formula, you will find that the probability of answering one out of two items correctly is 0.5 and that the probability of answering two out of two items correctly is 0.25. Thus, the probability of a student having a score greater than 0 is 0.75.

This question is similar to one of the questions we answered using *z*-scores and the standard normal distribution: What is the probability of a score being greater than 80 assuming that the population mean is 50 and the standard deviation is 15? In the case of our true/false quiz the distribution is based on discrete rather than continuous data. In both cases, however, we have a distribution and are asking about the probability of a score greater than a given point on the distribution.

4.4 In Chapter 1 we agreed to always conduct a two-tailed test unless there were compelling reasons to resort to a one-tailed test. This is a situation where it might make sense to consider a one-tailed test. Certainly it makes little sense to suppose studying is detrimental to performance. The way to evaluate your student’s claim with a one-tailed test is to determine if guessing eight or more items correctly has a probability less than 0.05. A probability less than 0.05 would put the score outside of the one-tailed 95% confidence interval for the ‘guessing’ population. After calculating the probabilities of guessing, eight, nine, and ten items correctly we find the corresponding probabilities to be 0.044, 0.010, and 0.001. The sum of the probabilities is 0.055. Because the probability of a score of 8 or greater is greater than 0.05, you would fail to reject the null hypothesis and thus again conclude that there is insufficient evidence to support the notion that the student was doing anything more than guessing.

4.5 Recall that the mean of a binomial distribution is equal to the probability of success multiplied by the number of trials: *n*(*p*). In this case the mean of the population would be 10(0.25) or 2.5. The probability of guessing eight or more of the ten items correctly requires computing the probabilities of guessing eight, nine, and ten items correctly. Using the binomial formula with the probability of 0.25 as success and 0.75 as failure you find the probabilities of correctly guessing eight, nine, and ten items to be 0.0004, 0.00003, and 0.00001, respectively. The sum of the probabilities is 0.00044. Thus the probability of guessing eight or more items correctly in a true/false quiz when the probability of guessing correctly is 0.25 is 0.00044. Because the probability of guessing eight or more items correctly (0.00044) is less than 0.05 you would reject the null hypothesis and conclude that the subject is doing more than guessing.

4.6 To answer this question you must not assume that the mouse has taken eight steps forward. It is an easy mistake to make. The mouse is eight steps forward from where it started. If the mouse took ten steps, how is it possible to be eight steps forward from where it started? Eight steps forward and two backward will not work. That would place the mouse six steps forward from where it started. To be eight steps forward from where it started the mouse needed to take some combination of nine steps forward and one step backward. Now the issue is a straightforward binomial problem. What is the probability of taking nine or more steps forward, if the probability of a step forward is .06? Using the binomial formula you find that the probabilities of nine and ten steps forward are 0.040 and 0.006, respectively. Summing the two probabilities tells you that the probability of nine or more steps forward, if the mouse has ingested the toxin, is 0.046. Because the probability is less than 0.05 you reject the null hypothesis. Remember, because we are using the probability associated with having ingested the toxin (0.6) in constructing the binomial distribution, the null hypothesis is that the mouse has ingested the toxin. Thus, you conclude there is evidence that the mouse has *not *ingested the toxin.

4.7 Although changing the test proportion from 0.5 to 0.3 increased the probability of 80 or more out of 100 increases to 0.016, it remains less than 0.05. Thus, we continue to reject the null hypothesis.

4.8 To answer the question you need to identify the probability of preferring comedy. If you assume that the community are equally divided between comedy and tragedy, then the null hypothesis is that the probability of preferring comedy is 0.5. Using the binomial formula, you find that the probability of 8 or more respondents (out of 10) preferring comedy is 0.055. Because the probability is greater than 0.05 you fail to reject the null hypothesis. Thus, you conclude that there is insufficient evidence to reject the assumption that the community are evenly split between comedy and tragedy.

4.9 To answer the question you need to identify the probability of preferring comedy. Assuming that the community are equally divided between comedy and tragedy, then the null hypothesis is that the probability of preferring comedy is 0.5. Using the binomial formula you find that the probability of 80 or more respondents (out of 100) preferring comedy approaches 0.000. Because the probability is less than 0.05 you reject the null hypothesis. Thus, you conclude that there is sufficient evidence to reject the assumption that the community are evenly split between comedy and tragedy. This supports the notion that most people in the community prefer comedy.

4.11 The *χ*^{2} value for the *G*-test is 4.44. With a critical *χ*^{2} value (*df* = 1) of 3.84 the null hypothesis is rejected. The *χ*^{2} value for the *χ*^{2} goodness-of-fit test is 4.26. Again, with a critical *χ*^{2} value (*df* = 1) of 3.84 the null hypothesis is rejected. The binomial test results in a *p*-value of 0.064. Because the *p*-value is greater than 0.05 the null hypothesis is not rejected. This shows that when results are borderline, there can be differences in the outcome of the three tests. The differences are often large enough to produce different conclusions. When sample sizes are small it appears that the binomial is the more conservative test. Remember, with respect to results of the *G*-test and of the *χ*^{2} goodness-of-fit test, we may be making a Type I error. However, with respect to the binomial test, we may be making a Type II error. The combination of small sample size and borderline results is always discomforting for the researcher. Replication or the collection of additional data is required where possible.