Randomization Tests - Beyond One/Two Sample Means & Proportions

Slides:



Advertisements
Similar presentations
StatKey Online Tools for Teaching a Modern Introductory Statistics Course Robin Lock St. Lawrence University USCOTS Breakout – May 2013 Patti Frazer Lock.
Advertisements

Bootstraps and Scrambles: Letting Data Speak for Themselves Robin H. Lock Burry Professor of Statistics St. Lawrence University Science.
StatKey Online Tools for Teaching a Modern Introductory Statistics Course Robin Lock Burry Professor of Statistics St. Lawrence University
© 2011 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license.
A Fiddler on the Roof: Tradition vs. Modern Methods in Teaching Inference Patti Frazer Lock Robin H. Lock St. Lawrence University Joint Mathematics Meetings.
STAT 101 Dr. Kari Lock Morgan Exam 2 Review.
Connecting Simulation- Based Inference with Traditional Methods Kari Lock Morgan, Penn State Robin Lock, St. Lawrence University Patti Frazer Lock, St.
StatKey: Online Tools for Bootstrap Intervals and Randomization Tests Kari Lock Morgan Department of Statistical Science Duke University Joint work with.
Using Bootstrap Intervals and Randomization Tests to Enhance Conceptual Understanding in Introductory Statistics Kari Lock Morgan Department of Statistical.
Using Lock5 Statistics: Unlocking the Power of Data
Using Randomization Methods to Build Conceptual Understanding of Statistical Inference: Day 2 Lock, Lock, Lock Morgan, Lock, and Lock MAA Minicourse- Joint.
Robin Lock St. Lawrence University USCOTS Opening Session.
Introducing Inference with Bootstrapping and Randomization Kari Lock Morgan Department of Statistical Science, Duke University with.
Implementing a Randomization-Based Curriculum for Introductory Statistics Robin H. Lock, Burry Professor of Statistics St. Lawrence University Breakout.
CHI SQUARE TESTS.
Statistics: Unlocking the Power of Data Lock 5 Exam 2 Review STAT 101 Dr. Kari Lock Morgan 11/13/12 Review of Chapters 5-9.
Using Bootstrapping and Randomization to Introduce Statistical Inference Robin H. Lock, Burry Professor of Statistics Patti Frazer Lock, Cummings Professor.
Statistics: Unlocking the Power of Data Lock 5 STAT 101 Dr. Kari Lock Morgan 10/30/12 Chi-Square Tests SECTIONS 7.1, 7.2 Testing the distribution of a.
Single-Factor Studies KNNL – Chapter 16. Single-Factor Models Independent Variable can be qualitative or quantitative If Quantitative, we typically assume.
Remember You just invented a “magic math pill” that will increase test scores. On the day of the first test you give the pill to 4 subjects. When these.
Chapter Fifteen Chi-Square and Other Nonparametric Procedures.
Synthesis and Review 2/20/12 Hypothesis Tests: the big picture Randomization distributions Connecting intervals and tests Review of major topics Open Q+A.
Bootstraps and Scrambles: Letting a Dataset Speak for Itself Robin H. Lock Patti Frazer Lock ‘75 Burry Professor of Statistics Cummings Professor of MathematicsSt.
The Chi-square Statistic
Nonparametric Statistics
Big Data Visualization in Intro Stats (in 15 minutes!)
CHAPTER 26 Comparing Counts.
Introducing Statistical Inference with Resampling Methods (Part 1)
Chi-Square hypothesis testing
Dr. Siti Nor Binti Yaacob
Randomization Tests PSU /2/14.
Introduction The two-sample z procedures of Chapter 10 allow us to compare the proportions of successes in two populations or for two treatments. What.
R. E. Wyllys Copyright 2003 by R. E. Wyllys Last revised 2003 Jan 15
Active Learning Lecture Slides
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 25 Comparing Counts.
INF 397C Fall, 2003 Days 13.
Chapter 5 Hypothesis Testing
Chapter 11 Goodness-of-Fit and Contingency Tables
Nonparametric Statistics
Connecting Intuitive Simulation-Based Inference to Traditional Methods
Single-Factor Studies
Review of Hypothesis Testing
Is a persons’ size related to if they were bullied
AP Stats Check In Where we’ve been… Chapter 7…Chapter 8…
Chi Square Two-way Tables
Single-Factor Studies
Hypothesis testing. Chi-square test
Using Simulation Methods to Introduce Inference
CHAPTER 11 Inference for Distributions of Categorical Data
Improving Conceptual Understanding in Intro Stats
Using Simulation Methods to Introduce Inference
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 26 Comparing Counts.
Goodness of Fit.
Improving Conceptual Understanding in Intro Stats
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 26 Comparing Counts.
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 26 Comparing Counts Copyright © 2009 Pearson Education, Inc.
Inference for Two Way Tables
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
‘The’ Second Course in Statistics
Chapter 26 Comparing Counts.
CHAPTER 11 Inference for Distributions of Categorical Data
Review of Hypothesis Testing
CHAPTER 11 Inference for Distributions of Categorical Data
Chi Square Test of Homogeneity
Presentation transcript:

Randomization Tests - Beyond One/Two Sample Means & Proportions Patti Frazer Lock, St. Lawrence University Robin Lock, St. Lawrence University Kari Lock Morgan, Penn State USCOTS 2019

Randomization Test Basic Procedure: Calculate a test statistic for the original sample. Simulate a new (randomization) sample under the null hypothesis. Calculate the test statistic for the new sample. Repeat 2 & 3 thousands of times to generate a randomization distribution. Find a p-value as the proportion of simulated samples that give a test statistic as (or more) extreme as the original sample.

How do we use the data to simulate samples under this null hypothesis? Tests in this Breakout Chi-square goodness-of-fit Chi-square test for association ANOVA for means ANOVA for regression Cat. vs. Cat. Cat. vs. Quant. Quant. vs. Quant. These all test for a relationship How do we use the data to simulate samples under this null hypothesis? 𝐻 0 : No relationship

No Relationship via Scrambling 𝑥 1 𝑦 1 𝑦 1 𝑥 2 𝑦 2 𝑦 2 𝑥 3 𝑦 3 𝑦 3 𝑥 4 𝑦 4 𝑦 4 𝑥 5 𝑦 5 𝑦 5 𝑥 6 𝑦 6 𝑦 6 𝑥 7 𝑦 7 𝑦 7 𝑥 8 𝑦 8 𝑦 8 𝑥 9 𝑦 9 𝑦 9 Two Quantitative

No Relationship via Scrambling 𝑥 1 𝑦 8 𝑦 1 𝑥 2 𝑦 7 𝑦 2 𝑥 3 𝑦 5 𝑦 3 𝑥 4 𝑦 4 𝑦 4 𝑥 5 𝑦 1 𝑦 5 𝑥 6 𝑦 6 𝑦 6 𝑥 7 𝑦 9 𝑦 7 𝑥 8 𝑦 2 𝑦 8 𝑥 9 𝑦 3 𝑦 9 Two Quantitative

No Relationship via Scrambling 𝑥 1 𝑦 1 𝐴 𝑦 1 𝑦 1 𝑥 2 𝑦 2 𝐴 𝑦 2 𝑦 2 𝑥 3 𝑦 3 𝐴 𝑦 3 𝑦 3 𝑥 4 𝑦 4 𝐵 𝑦 4 𝑦 4 𝑥 5 𝑦 5 𝐵 𝑦 5 𝑦 5 𝑥 6 𝑦 6 𝐵 𝑦 6 𝑦 6 𝑥 7 𝑦 7 𝐶 𝑦 7 𝑦 7 𝑥 8 𝑦 8 𝐶 𝑦 8 𝑦 8 𝑥 9 𝑦 9 𝐶 𝑦 9 𝑦 9 Two Quantitative One Categorical One Quantitative

No Relationship via Scrambling 𝑥 1 𝑦 8 𝐴 𝑦 8 𝑦 1 𝑥 2 𝑦 7 𝐴 𝑦 7 𝑦 2 𝑥 3 𝑦 5 𝐴 𝑦 5 𝑦 3 𝑥 4 𝑦 4 𝐵 𝑦 4 𝑦 4 𝑥 5 𝑦 1 𝐵 𝑦 1 𝑦 5 𝑥 6 𝑦 6 𝐵 𝑦 6 𝑦 6 𝑦 7 𝑥 7 𝑦 9 𝐶 𝑦 9 𝑥 8 𝑦 2 𝐶 𝑦 2 𝑦 8 𝑥 9 𝑦 3 𝐶 𝑦 3 𝑦 9 Two Quantitative One Categorical One Quantitative

No Relationship via Scrambling 𝑥 1 𝑦 1 𝐴 𝑦 1 𝐴 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 2 𝑦 2 𝐴 𝑦 2 𝐴 𝑛𝑜 𝑛𝑜 𝑥 3 𝑦 3 𝐴 𝑦 3 𝐴 𝑛𝑜 𝑛𝑜 𝑥 4 𝑦 4 𝐵 𝑦 4 𝐵 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 5 𝑦 5 𝐵 𝑦 5 𝐵 𝑛𝑜 𝑛𝑜 𝑥 6 𝑦 6 𝐵 𝑦 6 𝐵 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 7 𝑦 7 𝐶 𝑦 7 𝐶 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 8 𝑦 8 𝐶 𝑦 8 𝐶 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 9 𝑦 9 𝐶 𝑦 9 𝐶 𝑛𝑜 𝑛𝑜 Two Categorical Two Quantitative One Categorical One Quantitative

No Relationship via Scrambling 𝑥 1 𝑦 8 𝐴 𝑦 8 𝐴 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 2 𝑦 7 𝐴 𝑦 7 𝐴 𝑦𝑒𝑠 𝑛𝑜 𝑥 3 𝑦 5 𝐴 𝑦 5 𝐴 𝑛𝑜 𝑛𝑜 𝑥 4 𝑦 4 𝐵 𝑦 4 𝐵 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 5 𝑦 1 𝐵 𝑦 1 𝐵 𝑦𝑒𝑠 𝑛𝑜 𝑥 6 𝑦 6 𝐵 𝑦 6 𝐵 𝑦𝑒𝑠 𝑦𝑒𝑠 𝑥 7 𝑦 9 𝐶 𝑦 9 𝐶 𝑛𝑜 𝑦𝑒𝑠 𝑥 8 𝑦 2 𝐶 𝑦 2 𝐶 𝑛𝑜 𝑦𝑒𝑠 𝑥 9 𝑦 3 𝐶 𝑦 3 𝐶 𝑛𝑜 𝑛𝑜 Two Categorical Two Quantitative One Categorical One Quantitative

Let technology take care of calculations What Statistic? We can scramble to simulate samples under a null of “no relationship”. What statistic should we compute for each sample? Chi-square for Association: 𝜒 2 =∑ 𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑−𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 2 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 Let technology take care of calculations ANOVA for Means: 𝐹= 𝑀𝑆𝐺 𝑀𝑆𝐸 = ∑ 𝑛 𝑖 𝑥 𝑖 − 𝑥 2 /𝑑 𝑓 1 ∑ 𝑥− 𝑥 𝑖 2 /𝑑 𝑓 2 ANOVA for Regression: 𝐹= 𝑀𝑆𝑀𝑜𝑑𝑒𝑙 𝑀𝑆𝐸 = ∑ 𝑦 − 𝑦 2 /𝑑 𝑓 1 ∑ 𝑦− 𝑦 2 /𝑑 𝑓 2

Example #1: Which Award? If you could win an Olympic Gold Medal, Academy Award, or Nobel Prize, which would you choose? Do think the distributions will differ between male and female students? Olympic Academy Nobel Male 109 11 73 193 Female 20 76 169 182 31 149 n=362 (97.0) (16.5) (79.4) (85.0) (14.5) (69.6) 𝜒 2 =8.24 Is that an unusually large value?

Randomization for Awards Shuffle 362 cards (193 male, 169 female) Randomly deal 182 cards to Olympic, 31 to Academy, and the remaining 149 to Nobel. Find the two-way table (Sex x Award) and compute 𝜒 2 . Repeat 1,000’s of times to get a distribution under the null. Time for technology… http://lock5stat.com/statkey

Theoretical 𝜒 2 𝑑𝑓 2

Example #2: Sandwich Ants Experiment: Place pieces of sandwich on the ground, count how many ants are attracted. Does it depend on filling? Favourite Experiments: An Addendum to What is the Use of Experiments Conducted by Statistics Students? Margaret Mackisack http://www.amstat.org/publications/jse/v2n1/mackisack.supp.html

Randomization for Ants Write the 24 ant counts on cards. Shuffle and deal 8 cards to each sandwich type. Construct the ANOVA table and find the F-statistic. Repeat 1,000’s of times to get a distribution under the null.

Theoretical 𝐹 2,21

Example #3: Predicting NBA Wins Predictor: PtsFor (Points scored per game) 𝑊𝑖𝑛𝑠 =−213.8+2.48⋅𝑃𝑡𝑠𝐹𝑜𝑟

Randomization for NBA Wins Put the 30 win values on cards. Shuffle and deal the cards to assign a number of Wins randomly to each team. Compute the F-statistic when predicting Wins by PtsFor based on the scrambled sample. Repeat 1,000’s of times to get a distribution under the null.

Theoretical 𝜒 2 𝑑𝑓 2

Example #4: Rock, Paper, Scissors Play best of three games each. Record counts for all choices. Rock Paper Scissors (72) 65 67 84 n=216 Let p1, p2, p3 be the respective population proportions 𝐻 0 : 𝑝 1 = 𝑝 2 = 𝑝 3 =1/3 𝐻 𝑎 :𝑆𝑜𝑚𝑒 𝑝 𝑖 ≠1/3 Expected=𝑛 𝑝 𝑖 =216∙ 1 3 =72 𝜒 2 = 65−72 2 72 + 67−72 2 72 + 84−72 2 72 =3.03

Randomization for RPS Start with an equal number of Rock, Paper, and Scissor cards. Sample 216 times with replacement. Construct the table of counts and compute a chi- square statistic Repeat 1000’s of times to get a distribution under 𝐻 0 : 𝑝 1 = 𝑝 2 = 𝑝 3 .

Theoretical 𝐹 2,21

If we were ONLY using randomization, would we still use these? What Statistic? Chi-square for Association: 𝜒 2 =∑ 𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑−𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 2 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 ANOVA for Means: 𝐹= 𝑀𝑆𝐺 𝑀𝑆𝐸 = ∑ 𝑛 𝑖 𝑥 𝑖 − 𝑥 2 /𝑑 𝑓 1 ∑ 𝑥− 𝑥 𝑖 2 /𝑑 𝑓 2 ANOVA for Regression: 𝐹= 𝑀𝑆𝑀𝑜𝑑𝑒𝑙 𝑀𝑆𝐸 = ∑ 𝑦 − 𝑦 2 /𝑑 𝑓 1 ∑ 𝑦− 𝑦 2 /𝑑 𝑓 2 If we were ONLY using randomization, would we still use these?

What Statistic? But StatKey doesn’t do that statistic... library(mosaic) rand_dist=do(5000)*statistic(randomize(data)) SSqs=do(5000)*anova(lm(sample(y)~x,data=db)) library(infer) rand_dist <- data %>% specify(y ~ x) %>% hypothesize(null = "independence") %>% generate(reps = 10000, type = "permute") %>% calculate(stat = STATISTIC)

Thank you! QUESTIONS? Patti Frazer Lock: plock@stlawu.edu Robin Lock: rlock@stlawu.edu Kari Lock Morgan: klm47@psu.edu Slides posted at www.lock5stat.com