| Basic Commands |
Probability Puzzles |
Hypothesis Test, Count Data |
Hypothesis Test, Measured Data |
Confidence Interval, Count Data |
Confidence Interval, Measured Data |
Association / Correlation |
Regression |
Other Examples |
Cable TV
Problem
A newspaper poll of 50 voters showed that 30 approved a particular proposal for installing cable TV. The mayor, however, says his mail is running against this proposal. Can the mayor be correct? What is the probability that a sample of 50 voters from a population that is equally split could produce 30 "yes" votes?
Null hypothesis (H0): The electorate is equally split. Alternative hypothesis (H1): The electorate favors the proposal.
Resampling Procedure
How strong is the survey's evidence that the public favors the cable proposal? We worry about the possibility that they oppose it and we got a favorable sample just by chance. We can quantify our worry by constituting populations that oppose the proposal and observing whether simulated samples turn out favorable.
What hypothetical "opposed" population should we constitute? The one we worry about the most is the one that is just barely opposed to the proposal - that is the one most likely to mislead us with a favorable sample. If we can assure ourselves that a "just barely opposed" population will not produce a "favorable" sample to fool us, we will be even more assured that a "more substantially opposed" population will not fool us with a favorable sample. For convenience, we use an equally split population as a proxy for a "just barely opposed" population, hence that is our null hypothesis.
- Prepare an urn with one black ("no") and one white ("yes") ball.
- Take out one ball, note the color, and replace the ball. Do this 50 times. Record the result on a scoreboard.
- Repeat (2) 1,000 times.
- Sort the scoreboard results, and plot them in a histogram. Note how often the results from a random draw are 30 or more "yes" votes. Calculate the proportion of simulations with 30 or more "yes" votes.
Computer Implementation in Resampling Stats
URN 1#8 1#9 universe
Start by postulating the 50% approval universe; "8" stands for "no", "9" stands for "yes".
REPEAT 1000
SAMPLE 50 universe poll$
Generate a simulated sample of 50 voters.
COUNT poll$=9 ayes
How many of these want cable TV?
SCORE ayes scrboard
Save the results on a scoreboard
END
HISTOGRAM scrboard
COUNT scrboard >=30 yesvote
We asked how often the simulation would give results more than 30 "yes" votes.
DIVIDE yesvote 1000 kk
Convert to proportion
PRINT kk
Results
Frequency histogram of number of favorable responses
kk = 0.12
Conclusion
If only half of the town's electorate as a whole supported cable TV, a randomly selected poll of 50 residents could result in at least 30 "yes" votes about 12% of the time. Thus a small poll might yield an apparent majority favoring the cable system, despite overall opposition.