9 Tests for Proportion(s)
9.1 One-Sample Proportions
Note that proportion tests are only valid when \(np > 15\) and \(n(1-p)>15\). Here’s why. Notice how the normal approximation goes off the edges of the plot when \(np\) is small or \(n(1-p)\) is large.
R as a calculator
Confidence interval from class:
R as a sophisticated statistics program
R does a few slightly different things to account for the fact that the normal distribution is continuous but the binomial distribution is discrete, so the answer differs slightly (this is important for WeBWorK - check your work with R, but do it by hand)!
Notice that R also produces a hypothesis test. By default, it checks for \(H_0:p = 0.5\) versus a two-sided alternative.
For proportions, a confidence interval is not equivalent to a two-sided hypothesis test - the CI and the HT each use a different standard error!
9.2 Two-Sample Proportions
Again, R makes a great calculator - it lets you save numbers for use (and double-checking) later. Make sure you can do this by hand for the exam, though!!!
The prop.test() function also works with two samples! Again, R does some more sophisticated calculations to account for approximating a discrete distribution (Binomial) with a continuous distribution (Normal), called continuity correction.
Question: If we had done a “Plus Four” interval for the data above, do you think the it would be closer to R’s answer or further away? Think about it, then try it!
Notice that R also does a hypothesis test for you! How nice :)
9.3 Hypothesis Tests
From the Defective Computer Parts example: