Classroom Probability Simulations Using R: Margin of Error in a Public Opinion Poll

Similar documents
Gush vs. Bore: A Look at the Statistics of Sampling

Thinking About Chance & Probability Models

Computing Descriptive Statistics Argosy University

CHAPTER 10. Graphs, Good and Bad

Secondary Math Margin of Error

Modelling buyer behaviour - 2 Rate-frequency models

Sawtooth Software. Sample Size Issues for Conjoint Analysis Studies RESEARCH PAPER SERIES. Bryan Orme, Sawtooth Software, Inc.

Online Student Guide Types of Control Charts

Multiple Choice Questions Sampling Distributions

1/15 Test 1A. COB 191, Fall 2004

Modelling buyer behaviour/3 How survey results can mislead

Midterm 1 STAT-UB.0103 Statistics for Business Control and Regression Models

How Likely Are the Possible Values of a Statistic? The Sampling Distribution

Introduction to Statistics I

Term Test #2, ECO220Y, January 31, 2014 Page 1 of 12

CHAPTER 1 Defining and Collecting Data

Midterm Review Summer 2009 Chapters 1 7 Stat 111

6. The probability that you win at least $1 both time is (a) 1/2 (b) 4/36 (c) 1/36 (d) 1/4 (e) 3/4

Chapter 2: Probability. OpenIntro Statistics, 2nd Edition

Employee Engagement Survey Report Guide 2018

Module - 01 Lecture - 03 Descriptive Statistics: Graphical Approaches

Introduction to Business Statistics QM 120 Chapter 1

Chapter 4: Foundations for inference. OpenIntro Statistics, 2nd Edition

majority, plurality Polls are not perfect Margin of error Margin of error

Democracy Heroes Script

STA Module 2A Organizing Data and Comparing Distributions (Part I)

Common Mistakes in Performance Evaluation

Survey Question Analysis (Draft )

and Forecasting CONCEPTS

Statistics Definitions ID1050 Quantitative & Qualitative Reasoning

CHOSUN UNIVERSITY-SEOK-GANG,PARK CHAPTER 1 SECTION 1: WHAT IS STATISTICS?

MATH20 S PRE-CALCULUS UNIT H: PROBABIITY AND STATISTICS CLASS NOTES

STA Rev. F Learning Objectives. Learning Objectives (Cont.) Module 2 Organizing Data

AP Statistics: Chapter 4.1, Pages Summarized by Lauren Chambers, Logan Wagner, Jack Thompson

What Matters in Mentoring??

THE PIPA/KNOWLEDGE NETWORKS POLL.

Bandwagon and Underdog Effects and the Possibility of Election Predictions

Reputation cascades. University of Lausanne. From the SelectedWorks of Jean-Philippe Bonardi. Jean-Philippe Bonardi, University of Lausanne

AP Stats ~ Lesson 8A: Confidence Intervals OBJECTIVES:

Election Judge Workbook Voter Challenges Quiz

PEW RESEARCH CENTER ELECTION QUESTIONS

NASW-NC Social Media Policy Setting up Social Media- NASW-NC Professional Accounts

Chart Recipe ebook. by Mynda Treacy

AP Statistics Cumulative Practice Test 3 (Ch 1 Ch 13) Section I: Multiple Choice Choose the best answer.

Surveys. A long tradition

BUSS1020. Quantitative Business Analysis. Lecture Notes

A is used to answer questions about the quantity of what is being measured. A quantitative variable is comprised of numeric values.

Short Assignment Two Political Science 210, Empirical Political Theory Paul Gronke. Lab Sessions:

BUSS1020 Quantitative Business Analysis

Millennials are crowdsourcingyouhow companies and brands have the chance to do

Preference Elicitation for Group Decisions

How to Begin With Social Media for Your Business Success

Introduction to Artificial Intelligence. Prof. Inkyu Moon Dept. of Robotics Engineering, DGIST

1. Contingency Table (Cross Tabulation Table)

Patient persistency to prescribed medications,

Workshop #2: Evolution

MeltLab Systems Using Thermal Analysis in the foundry. Thermal Analysis Metrics by derivatives

CS 147: Computer Systems Performance Analysis

NDP submission to the Special Committee on Electoral Reform

EXAMINATIONS OF THE ROYAL STATISTICAL SOCIETY (formerly the Examinations of the Institute of Statisticians) ORDINARY CERTIFICATE IN STATISTICS, 2003

Networks: Fall 2010 Homework 5 David Easley and Eva Tardos Due November 11, 2011

Chapter 12. Sample Surveys. Copyright 2010 Pearson Education, Inc.

Voter Registration Guide

Untangling Correlated Predictors with Principle Components

Disruptive Strategy with Clayton Christensen

Carlo Fabrizio D'Amico

Measurement and sampling

Benefits, Costs, and Maximization

Topicality & Extra Topicality. Coloring inside the lines

Gasoline Consumption Analysis

THE IMPROVEMENTS TO PRESENT LOAD CURVE AND NETWORK CALCULATION

STAT 100 Chance and Data Analysis October 28, 2002(draft)

South Carolina State Poll

BOOTSTRAPPING AND CONFIDENCE INTERVALS

Ethics in Human Resource Management

Issue Review. Do Voters Understand Super PACs? March Jason M. Farrell Center for Competitive Politics

SUPRC Maine Statewide August 2018

FINAL EXAMINATION. Special Instructions: Date: DECEMBER 15, 2000 School Year: Course and No.: ECON1006EA Time: 1:30 PM- 3:30 PM

American Association for Public Opinion Research

Pareto Charts [04-25] Finding and Displaying Critical Categories

ARE YOUR CUSTOMER SERVICE METRICS TELLING THE TRUTH? Many rank frontline teams unfairly.

Part 1: Motivation, Basic Concepts, Algorithms

Folia Oeconomica Stetinensia DOI: /foli FORECASTING RANDOMLY DISTRIBUTED ZERO-INFLATED TIME SERIES

Grades in a Diploma Plus School

SHARE session Greg Caliri BMC Software, Inc. Lexington MA, USA

Frequency asked questions about the assignment. Introduction to tophat. Probability, conditional probability, marginal, and Bayes rule

Unit QUAN Session 6. Introduction to Acceptance Sampling

Estimating attendance at the Powell Street Festival

Near-Balanced Incomplete Block Designs with An Application to Poster Competitions

The slightest perception of something negative happening can affect an employee s emotional state.

The People, The Press & Politics. Campaign '92:

8. Consumption, uncertainty, and the current account

TEACHER NOTES MATH NSPIRED

COORDINATING DEMAND FORECASTING AND OPERATIONAL DECISION-MAKING WITH ASYMMETRIC COSTS: THE TREND CASE

36.2. Exploring Data. Introduction. Prerequisites. Learning Outcomes

TIMETABLING EXPERIMENTS USING GENETIC ALGORITHMS. Liviu Lalescu, Costin Badica

Statistics Summary Exercises

LOOKING BEHIND THE NUMBERS: HOW ARE YOUR STATISTICAL ETHICS?

Chapter 2 Tools of Positive Analysis

Experience iit ain t what iit used to be

Transcription:

Classroom Probability Simulations Using R: Margin of Error in a Public Opinion Poll Outstanding Professor Address, Part 2 Fall Faculty Convocation (9/21/04) Bruce E. Trumbo Department of Statistics, CSU Hayward www.sci.csuhayward.edu/~btrumbo 1

Margin of Error in a Public Opinion Poll Many polls quote a margin of sampling error depending on the number n of people sampled:! ± 2% for n = 2500! ± 3% for n = 1100! ± 4% for n = 625 2

For a candidate's lead: Double the margin of error. The SF Chronicle for 9/18/04 printed a front-page report on apparent discrepancies of recent polls in the Bush vs. Kerry US Presidential race. For a poll with a 4% margin of error the report made a mistake in the margin of error for Bush over Kerry. Following is the text of my letter to the editor on this mistake: 3

Editor -- John Wildermuth's report ["Fickle polls give little away: Bush way ahead or just behind depends on who asks", 9/18], while mainly excellent, contained a technical error about the margin of sampling error for the lead one candidate holds over another. It is true that a poll based on 767 randomly chosen respondents, of whom 55 percent prefer Bush and 42 percent prefer Kerry, had a 4-point margin of sampling error. So the number for Kerry may well have been between 38 percent and 46 percent, and for Bush between 51 percent and 59 percent. Bush's lead in this poll was 13 percent but, according to the laws of probability, the margin of sampling error for Bush's lead is twice as large -- about 8 points -- and his lead could have been anywhere between 5 points and 21 points. The 4-point margin of sampling error can also be misleading when you compare two independent polls. Margins of sampling error in polls are usually based on the goal of being right 95 percent of the time. When you compare a candidate's percentage (of likely votes) across two independent polls, the probability that both polls are correct drops to about 90 percent. Taking all these issues into account along with others, the discrepancies among various polls are hardly surprising. Of course, it is possible that some polls are deliberately biased, but just the inherent inaccuracies in honest, state-of-the-art polling -- especially with samples smaller than 1,000 taken in a volatile political season -- are enough to account for the "fickle" performance of polls that fuel so much partisan commentary. BRUCE E. TRUMBO / Professor of Statistics / California State University Hayward 4

What is the Basis for These Margins of Error?! Assume a random sample.! Ignore subjective issues.! Based on probability rules: hard to prove. Don't like to say "Because I said so"?! Simulation illustrates these rules.! Requires faith that a computer can take a random sample: excellent software.! We use R: State of the art and free. 5

Simulating an Election Poll To simplify, suppose:! No undecided voters.! 53% of voters favor Candidate A.! 47% of voters favor Candidate B.! Randomly sample 25 voters. Can we detect from data on 25 subjects that Candidate A is in the lead? 6

One Simulation Using R: > sample(0:1, 25, rep=t, prob=c(.47,.53)) [1] 1 0 1 1 0 0 1 0 0 1 0 0 0 [14] 0 1 0 1 0 1 1 1 0 1 1 0 Interpret 0s & 1s as candidate preferences A B A A B B A B B A B B B B A B A B A A A B A A B 12/25 = 48% for A. 7

What can we conclude from this survey of 25 subjects? Poll result after 25: A has 12 in favor: Proportion = 48% for A. Contradicts what we know about population. Intuitively, we know 25 is not a large enough number. How to look at this more objectively? 8

Find Proportions After Each Subject Table Below Used to Find 1 st Through 5 th Proportions Subj. so Far 1 2 3 4 5 Opinion A B A A B A s so Far 1 1 2 3 3 Prop. so Far 1/1 = 1.00 1/2 = 0.50 2/3 = 0.67 Then plot a trace of the poll. 3/4 = 0.75 3/5 = 0.60 9

Now plot the remaining 20 subjects. 10

Endpoint is 48%. What would other polls say? 11

Note: Here and below, vertical axis from 25% to 75% to help show detail. 12

13

14

Results Differ Widely. On one graph, now overlay 20 traces. 15

All traces end between 40% and 70%, most above 50%. 16

Vast majority of traces end between 30% and 75%. Misleading: 377 of the 1000 traces end below 50%. 17

Results fit a predictable, but useless pattern. A 25-subject poll can t show if A is winning. 18

Polls with n = 2500 Subjects Major polling organizations report such polls as having a ± 2% margin of sampling error. Intended Meaning: If the true proportion for A is 53%, then most 2500-subject polls (95%) will have endpoints between 51% and 55%, thus detecting that A is the favorite. 19

20

21

22

23

Red marks at right indicate 53% ± 2%. Green line at 50%. 24

On average run: 19 out of 20 traces (95%) within margin of error. 25

95% of endpoints within margin of error; only 3 in 1000 below 50%. 26

n=2500 n=25 In the interval from 51% to 55% for Candidate A : Black curve has 95% probability. Blue curve only about 12%. 27

Not all processes settle to a meaningful single limiting value, such as we have seen for polls. Here are 3 examples. The first shows a kind of Brownian motion process (uniformly distributed displacements around a circle); it approaches no limit. The second shows a brother-sister mating process (relax, it's for plants); it can approach either of two limits. The third shows what can happen with a random number generator of poor quality; it converges to an incorrect limit. (This illustrates the importance of using quality software such as R.) 28

From an example in a forthcoming book by E. Suess and B. Trumbo (Springer). 29

From an example in a forthcoming book by E. Suess and B. Trumbo (Springer). 30

x 0.48 0.49 0.50 0.51 0.52 0 5000 10000 15000 A bad pseudorandom number generator (black) causes rapid convergence to an incorrect limit. A good generator (green), slower convergence to the correct limit. Index 31

Some processes approach limiting distributions rather than limiting values. The limiting distribution is sometimes, but not always normal. Three examples follow: The first shows results from 5000 experiments, each tossing 10 000 fair coins. It is relatively unlikely for Heads to be in the lead anywhere near half the time. The second plots sample means against sample standard deviations for samples of size 5 from a bathtub-shaped beta distribution. The relationship between means and standard deviations is intricate. The third (mainly recreational) example shows that it is possible for the limiting distribution of a process to look like a nonmathematical object. 32

5000 Experiments Each With 10000 Tosses of a Fair Coin 0.0 0.5 1.0 1.5 2.0 0.0 0.2 0.4 0.6 0.8 1.0 Proportion of Time Head Count Exceeds Tail Count Based on W. Feller (1957): Intro. to Probability Theory and Its Applications, Vol. I [The "bathtub shaped" distribution is BETA(1/2, 1/2).] 33

From: B. Trumbo, E. Suess, C. Fraser: Using Computer Simulation to Investigate Relationships Between the Sample Mean and Standard Deviation, STATS 2001. 34

Based on M. Barnsley: Fractals Everywhere, Academic Press (1988) 35

Simulation Papers Presented by CSU Hayward Students at Joint Statistics Meetings, Toronto, Canada, August 2004. Papers illustrate pedagogical uses of R. Our sessions were extraordinarily well attended because of the current interest in using simulation to teach statistics. 36

B. Trumbo, E. Suess, C. Schupp: Using R to Compute Probabilities of Matching Birthdays. There are n people in a room. What is the probability two (or more) have the same birthday? If birthdays are uniform throughout the year, then the following graph (based on a simple formula, Stat 3401) gives the answer. 37

There is better than a 50-50 chance of a match when more than 23 people are in the room. Almost sure when there are more than 50. But US birthdays aren t uniform (36 months shown): 104% of average in Summer; 96% in Winter except for a spike of tax deduction babies in December. Empirical Daily Birth Proportions: By Month Jan '97 - Dec '99 Percent (Percent of Uniform = 1/365 Per Day) 105 100 95 0 10 20 30 40 Month Source: Nat'l Ctr. for Health Statistics 38

Simulation shows actual US nonuniformity doesn t much change the probability of getting no match, but extreme nonuniformity (left side of each graph) would. Assume half of annual births uniformly in Weeks and the other half uniformly in the rest of the year. Weeks=26 is uniform over the whole year. Each point above is based on 50,000 simulated rooms, with 25 people in each room. 39

B. Trumbo, E. Suess, R. Brafman: Classroom Simulation: Are Variance- Stabilizing Transformations Really Useful?" If data are exponentially distributed (instead of normally), some statistical procedures, such as an analysis of variance, may not work as they should. (Stat 3503.) Simulation shows when log and rank transformation of such data are helpful. 40

Power Against Various Alternatives When M = 1, H0 is true; when M = 2, the group means are 1, 2, 4; and when M = 4, the group means are 1, 4, 16; etc. Solid = Original Dotted = Log Transf Dashed = Rank Transf. Simulations for this graph required generating about 3 million ANOVAs, each with 15 observations. These transformations are helpful when samples are small. 41