Doing Bayesian Data Analysis by John K. Kruschke

Doing Bayesian Data Analysis by John K. Kruschke

Author:John K. Kruschke
Language: eng
Format: mobi, pdf
ISBN: 9780123814852
Publisher: Academic Press
Published: 2011-01-15T20:00:00+00:00


13.2. Sample Size for a Single Coin

As our first worked-out example, consider the simplest case: data from a single coin. Perhaps we are polling a population and we want to know if there is a preference for candidate A or candidate B. Or perhaps we want to know if a drug has more than a 50% cure rate. We will go through the steps listed in Section 13.1.2 to compute the exact sample size needed to achieve various degrees of power for different data-generating hypotheses.

13.2.1. When the Goal is to Exclude a Null Value

Suppose that our goal is to show that the coin is biased. In other words, we want to show that 0.5 is not among the credible values. More specifically, we want to show that the 95% HDI excludes .

Because of previous research (or just a really strong hunch), we think that the true bias of the coin is very close to . It is a strong belief, so we'll describe the data-generating hypothesis as a beta distribution with mean and certainty based on 2000 fictitious flips of the coin. This puts 95% of the data-generating biases between 0.63 and 0.67.

Next, we generate simulated data from hypothetical coins that have those biases, and tally how often the HDI excludes . One replication of the process goes like this: First, select a value for the “true” bias in the coin, from the data-generating distribution that is narrowly centered on . Suppose that the selected value is 0.638. Second, simulate flipping a coin with that bias times. The simulated data have heads and tails. The proportion of heads, , will tend to be around .638, but will be higher or lower because of randomness in the flips. Third, using the audience-agreed prior for purposes of data analysis, determine the posterior beliefs regarding if heads in flips were observed. Tally whether or not the 95% HDI excludes the null value of . Notice that even though the data were generated by a coin with bias of 0.638, the data might, by chance, show a low proportion of heads, and therefore the 95% HDI might not exclude . This process is repeated many times to estimate the probability that the null value will be excluded from the HDI. In fact, for this simple situation, the exact power can be computed analytically, as explained in Section 13.6.1 ( minNforHDIpower.R), p. 335.

Table 13.1 shows the minimal sample size needed for the 95% HDI to exclude when flipping a single coin. As an example of how to read the table, suppose you have a data-generating hypothesis that the coin has a bias very near . This hypothesis is implemented, for purposes of Table 13.1, as a beta distribution with shape parameters of and . The value of is arbitrary; it's as if the generating mean of 0.65 was based on fictitious previous data containing 2000 flips. The table indicates that if we desire a 90% probability of obtaining a 95% HDI that excludes , we need a sample size of (i.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.