## Wednesday, November 14, 2012

Testing a hypothesis with proportions can be easy.

For example:  Suppose the manufacturers of a certain brand of candy says that 40% of the pieces in the bag are red and the rest are green.   Suppose a bag of 50 pieces of candy is opened and 15 of them are green.  We can run a test to see if our claim  is true based on the sample size and sample proportion. We will chose to test at 5% significance.

Step 1:   state your null and alternate hypothesis.  The null hypothesis is what is claimed.

The null hypothesis is that 40% are green. The alternate hypothesis is proportion of green is not 40%

Step 2:  calculate the test statistic

Z = (p^ - p)/standard deviation

p^ is the sample proportion of candy that is green = 15/50 = .30

p is the claimed proportion of candy that is green = .40

square root[(p)(1-p)/n] = standard deviation = 0.0693

test statistic = (p^ - p)/standard deviation = -1.44

Step 3:  compare test statistic with critical value for the test. For 95% and 2 tailed test, this value is 1.96 and -1.96

If the test statistic is greater than 1.96 or less than -1.96 we reject the null hypothesis, otherwise we accept the null hypothesis.

In this case we accept the null hypothesis.