using&randomiza-on&methods&to& … · 2014-10-29 ·...
TRANSCRIPT
Using Randomiza-on Methods to Build Conceptual Understanding in
Sta-s-cal Inference: Day 1
Lock, Lock, Lock, Lock, and Lock MAA Minicourse – Joint Mathema6cs Mee6ngs
San Diego, CA January 2013
The Lock5 Team
Robin St. Lawrence
Dennis Iowa State
Eric Duke
Kari Duke
PaD St. Lawrence
Introduc6ons:
Name Ins6tu6on
Schedule: Day 1 Wednesday, 1/9, 9:00 – 11:00 am
1. Introduc-ons and Overview
2. Bootstrap Confidence Intervals • What is a bootstrap distribu6on? • How do we use bootstrap distribu6ons to build understanding of confidence intervals? • How do we assess student understanding when using this approach?
3. GeDng Started on Randomiza-on Tests • What is a randomiza6on distribu6on? • How do we use randomiza6on distribu6ons to build understanding of p-‐values?
4. Minute Papers
Schedule: Day 2 Friday, 1/11, 9:00 – 11:00 am
5. More on Randomiza-on Tests • How do we generate randomiza6on distribu6ons for various sta6s6cal tests?
• How do we assess student understanding when using this approach?
6. Connec-ng Intervals and Tests 7. Connec-ng Simula-on Methods to Tradi-onal
8. Technology Op-ons • Brief soSware demonstra6on (Minitab, Fathom, R, Excel, ...) – pick one!
9. Wrap-‐up • How has this worked in the classroom? • Par6cipant comments and ques6ons
10. Evalua-ons
Why use Randomiza6on Methods?
These methods are great for teaching sta6s6cs…
(the methods 6e directly to the key ideas of sta6s6cal inference
so help build conceptual understanding)
And these methods are becoming increasingly important for doing
sta6s6cs.
It is the way of the past…
"Actually, the statistician does not carry out this very simple and very tedious process [the randomization test], but his conclusions have no justi;ication beyond the fact that they agree with those which could have been arrived at by this elementary method."
-‐-‐ Sir R. A. Fisher, 1936
… and the way of the future “... the consensus curriculum is still an unwitting prisoner of history. What we teach is largely the technical machinery of numerical approximations based on the normal distribution and its many subsidiary cogs. This machinery was once necessary, because the conceptually simpler alternative based on permutations was computationally beyond our reach. Before computers statisticians had no choice. These days we have no excuse. Randomization-‐based inference makes a direct connection between data production and the logic of inference that deserves to be at the core of every introductory course.”
-‐-‐ Professor George Cobb, 2007
(see full TISE article by Cobb in your binder)
Ques6on
Do you teach Intro Stat? A. Very regularly (most semesters) B. Regularly (most years) C. Occasionally D. Rarely (every few years) E. Never (or not yet)
Ques6on How familiar are you with simula6on methods such as bootstrap confidence intervals and randomiza6on tests? A. Very B. Somewhat C. A liale D. Not at all E. Never heard of them before!
Ques6on
Have you used randomiza6on methods in Intro Stat? A. Yes, as a significant part of the course B. Yes, as a minor part of the course C. No D. What are randomiza6on methods?
Ques6on
Have you used randomiza6on methods in any sta6s6cs class that you teach? A. Yes, as a significant part of the course B. Yes, as a minor part of the course C. No D. What are randomiza6on methods?
Intro Stat – Revise the Topics • Descrip6ve Sta6s6cs – one and two samples • Normal distribu6ons • Data produc6on (samples/experiments)
• Sampling distribu6ons (mean/propor6on)
• Confidence intervals (means/propor6ons)
• Hypothesis tests (means/propor6ons)
• ANOVA for several means, Inference for regression, Chi-‐square tests
• Data produc6on (samples/experiments) • Bootstrap confidence intervals • Randomiza6on-‐based hypothesis tests • Normal distribu6ons
• Bootstrap confidence intervals • Randomiza6on-‐based hypothesis tests
• Descrip6ve Sta6s6cs – one and two samples
We need a snack!
What propor-on of Reese’s Pieces are
Orange? Find the propor6on that are orange
for your “sample”.
Propor6on orange in 100 samples of size n=100
BUT – In prac6ce, can we really take lots of samples from the same popula6on?
Bootstrap Distribu-ons
Or: How do we get a sense of a sampling distribu6on when we only have ONE sample?
Suppose we have a random sample of 6 people:
Original Sample
Create a “sampling distribu6on” using this as our simulated popula6on
Bootstrap Sample: Sample with replacement from the original sample, using the same sample size.
Original Sample Bootstrap Sample
Simulated Reese’s Popula6on
Sample from this “popula6on”
Original Sample
Create a bootstrap sample by sampling with replacement from the original sample.
Compute the relevant sta6s6c for the bootstrap sample.
Do this many 6mes!! Gather the bootstrap sta6s6cs all together to form a bootstrap distribu6on.
Original Sample
BootstrapSample
BootstrapSample
BootstrapSample
● ● ●
Bootstrap Sta6s6c
Sample Sta6s6c
Bootstrap Sta6s6c
Bootstrap Sta6s6c
● ● ●
Bootstrap Distribu6on
Example: What is the average price of a used Mustang car?
Select a random sample of n=25 Mustangs from a website (autotrader.com) and record the price (in $1,000’s) for each car.
Sample of Mustangs:
Our best es6mate for the average price of used Mustangs is $15,980, but how accurate is that es6mate?
Price0 5 10 15 20 25 30 35 40 45
MustangPrice Dot Plot
𝑛=25 𝑥 =15.98 𝑠=11.11
Original Sample Bootstrap Sample
We need technology!
Introducing
StatKey. www.lock5stat.com/statkey
StatKey
Std. dev of 𝑥 ’s=2.18
Using the Bootstrap Distribu6on to Get a Confidence Interval – Method #1 The standard devia6on of the bootstrap sta6s6cs es6mates the standard error of the sample sta6s6c.
Quick interval es6mate :
𝑂𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 ±2∙𝑆𝐸
For the mean Mustang prices: 15.98±2∙2.18=15.98±4.36=(11.62, 20.34)
Using the Bootstrap Distribu6on to Get a Confidence Interval – Method #2
Keep 95% in middle
Chop 2.5% in each tail
Chop 2.5% in each tail
We are 95% sure that the mean price for Mustangs is between $11,930 and $20,238
Bootstrap Confidence Intervals Version 1 (Sta6s6c ± 2 SE): Great prepara6on for moving to tradi6onal methods Version 2 (Percen6les): Great at building understanding of confidence intervals
Playing with StatKey!
See the purple pages in the folder.
Traditional Inference 1. Which formula?
2. Calculate summary stats
5. Plug and chug
𝑥 ± 𝑡↑∗ ∙ 𝑠⁄√𝑛 𝑥 ± 𝑧↑∗ ∙ 𝜎⁄√𝑛
𝑛=25, 𝑥 =15.98, 𝑠=11.11
3. Find t*
95% CI ⇒ 𝛼⁄2 = 1−0.95/2 =0.025
4. df?
df=25−1=24
OR
t*=2.064
15.98±2.064∙ 11.11⁄√25
15.98±4.59=(11.39, 20.57)
6. Interpret in context
CI for a mean
7. Check condi6ons
We want to collect some data from you. What should
we ask you for our one quan6ta6ve ques6on and
our one categorical ques6on?
What quan6ta6ve data should we collect from you? A. What was the class size of the Intro Stat course you
taught most recently? B. How many years have you been teaching Intro Stat? C. What was the travel 6me, in hours, for your trip to
Boston for JMM? D. Including this one, how many 6mes have you aaended
the January JMM? E. ???
What categorical data should we collect from you? A. Did you fly or drive to these mee6ngs? B. Have you aaended any previous JMM mee6ngs? C. Have you ever aaended a JSM mee6ng? D. ??? E. ???
Why does the bootstrap
work?
Sampling Distribu6on
Popula6on
µ
BUT, in prac6ce we don’t see the “tree” or all of the “seeds” – we only have ONE seed
Bootstrap Distribu6on
Bootstrap “Popula6on”
What can we do with just one seed?
Grow a NEW tree!
𝑥
Es6mate the distribu6on and variability (SE) of 𝑥 ’s from the bootstraps
µ
Golden Rule of Bootstraps
The bootstrap sta3s3cs are to the original sta3s3c
as the original sta3s3c is to the popula3on parameter.
How do we assess student understanding of these methods (even on in-‐class exams without computers)?
See the green pages in the folder.
hap://www.youtube.com/watch?v=3ESGpRUMj9E
Paul the Octopus
hap://www.cnn.com/2010/SPORT/football/07/08/germany.octopus.explainer/index.html
• Paul the Octopus predicted 8 World Cup games, and predicted them all correctly
• Is this evidence that Paul actually has psychic powers?
• How unusual would this be if he were just randomly guessing (with a 50% chance of guessing correctly)?
• How could we figure this out?
Paul the Octopus
• Each coin flip = a guess between two teams • Heads = correct, Tails = incorrect • Flip a coin 8 6mes and count the number of heads. Remember this number!
Did you get all 8 heads?
(a) Yes (b) No
Simulate!
Let p denote the propor6on of games that Paul guesses correctly (of all games he may have predicted)
H0 : p = 1/2 Ha : p > 1/2
Hypotheses
• A randomiza3on distribu3on is the distribu6on of sample sta6s6cs we would observe, just by random chance, if the null hypothesis were true • A randomiza6on distribu6on is created by simula6ng many samples, assuming H0 is true, and calcula6ng the sample sta6s6c each 6me
Randomiza-on Distribu-on
• Let’s create a randomiza6on distribu6on for Paul the Octopus!
• On a piece of paper, set up an axis for a dotplot, going from 0 to 8
• Create a randomiza6on distribu6on using each other’s simulated sta6s6cs
• For more simula6ons, we use StatKey
Randomiza-on Distribu-on
• The p-‐value is the probability of geyng a sta6s6c as extreme (or more extreme) as that observed, just by random chance, if the null hypothesis is true
• This can be calculated directly from the randomiza6on distribu6on!
p-‐value
StatKey
( )81 0.00392 =
• Create a randomiza6on distribu6on by simula6ng assuming the null hypothesis is true
• The p-‐value is the propor6on of simulated sta6s6cs as extreme as the original sample sta6s6c
Randomiza-on Test
• How do we create randomiza6on distribu6ons for other parameters?
• How do we assess student understanding? • Connec6ng intervals and tests • Connec6ng simula6ons to tradi6onal methods
• Technology for using simula6on methods
• Experiences in the classroom
Coming Aarac-ons -‐ Friday
Using Randomiza-on Methods to Build Conceptual Understanding
of Sta-s-cal Inference: Day 2
Lock, Lock, Lock, Lock, and Lock MAA Minicourse-‐ Joint Mathema6cs Mee6ngs
San Diego, CA January 2013
Schedule: Day 2 Friday, 1/11, 9:00 – 11:00 am
5. More on Randomiza-on Tests • How do we generate randomiza6on distribu6ons for various sta6s6cal tests?
• How do we assess student understanding when using this approach?
6. Connec-ng Intervals and Tests 7. Connec-ng Simula-on Methods to Tradi-onal
8. Technology Op-ons • Brief soSware demonstra6on (Minitab, R, Excel, more StatKey...)
9. Wrap-‐up • How has this worked in the classroom? • Par6cipant comments and ques6ons
10. Evalua-ons
• In a randomized experiment on treating cocaine addiction, 48 people were randomly assigned to take either Desipramine (a new drug), or Lithium (an existing drug)
• The outcome variable is whether or not a patient relapsed
• Is Desipramine signi;icantly better than Lithium at treating cocaine addiction?
Cocaine Addiction
R R R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R
R R R R R R
R R R R R R
R R R R R R
R R R R
R R R R R R
R R R R R R
R R R R R R
Desipramine Lithium
1. Randomly assign units to treatment groups
R R R R
R R R R R R
R R R R R R
N N N N N N
R R R R R R
R R R R N N
N N N N N N
R R
N N N N N N
R = Relapse N = No Relapse
R R R R
R R R R R R
R R R R R R
N N N N N N
R R R R R R
R R R R R R
R R N N N N
R R
N N N N N N
2. Conduct experiment
3. Observe relapse counts in each group
Lithium Desipramine
10 relapse, 14 no relapse 18 relapse, 6 no relapse
1. Randomly assign units to treatment groups
10 1824
ˆ ˆ
24.333
new oldp p
= −
= −
−
• Assume the null hypothesis is true • Simulate new randomizations • For each, calculate the statistic of interest • Find the proportion of these simulated statistics that are as extreme as your observed statistic
Randomization Test
R R R R
R R R R R R
R R R R R R
N N N N N N
R R R R R R
R R R R N N
N N N N N N
R R
N N N N N N
10 relapse, 14 no relapse 18 relapse, 6 no relapse
R R R R R R
R R R R N N
N N N N N N
N N N N N N
R R R R R R
R R R R R R
R R R R R R
N N N N N N
R N R N
R R R R R R
R N R R R N
R N N N R R
N N N R
N R R N N N
N R N R R N
R N R R R R
Simulate another randomiza6on
Desipramine Lithium
16 relapse, 8 no relapse 12 relapse, 12 no relapse
ˆ ˆ16 1224 240.167
N Op p−
= −
=
R R R R
R R R R R R
R R R R R R
N N N N N N
R R R R R R
R N R R N N
R R N R N R
R R
R N R N R R
Simulate another randomiza6on
Desipramine Lithium
17 relapse, 7 no relapse 11 relapse, 13 no relapse
ˆ ˆ17 1124 240.250
N Op p−
= −
=
• Start with 48 cards (Relapse/No relapse) to match the original sample.
• Shuf;le all 48 cards, and rerandomize them into two groups of 24 (new drug and old drug)
• Count “Relapse” in each group and ;ind the difference in proportions, 𝑝 ↓𝑁 − 𝑝 ↓𝑂 .
• Repeat (and collect results) to form the randomization distribution.
• How extreme is the observed statistic of -‐0.33?
Physical Simulation
The observed difference in propor6ons was -‐0.33. How unlikely is this if there is no difference in the drugs? To begin to get a sense of this: How many of you had a randomly simulated difference in propor6ons this extreme?
Was your simulated difference in propor6ons more extreme than the sample sta6s6c (that is, was it less than or equal to -‐0.33)?
A. Yes B. No
A randomization sample must: • Use the data that we have (That’s why we didn’t change any of the results on the cards) AND • Match the null hypothesis (That’s why we assumed the drug didn’t matter and combined the cards)
Cocaine Addiction
StatKey
The probability of getting results as extreme or more extreme than those observed if the null hypothesis is true, is about .02. p-‐value
Propor6on as extreme as observed sta6s6c
observed sta6s6c
Distribu6on of Sta6s6c Assuming Null is True
How can we do a randomiza-on test for a correla-on?
Is the number of penal6es given to an NFL team posi6vely correlated with the “malevolence” of the team’s uniforms?
Ex: NFL uniform “malevolence” vs. Penalty yards
r = 0.430 n = 28
Is there evidence that the popula6on correla6on is posi6ve?
Key idea: Generate samples that are (a) consistent with the null hypothesis (b) based on the sample data.
H0 : ρ = 0
r = 0.43, n = 28
How can we use the sample data, but ensure that the correla6on is zero?
Randomize one of the variables!
Let’s look at StatKey.
Traditional Inference 1. Which formula?
2. Calculate numbers and plug into formula
3. Plug into calculator
4. Which theore6cal distribu6on?
5. df?
6. find p-‐value
0.01 < p-‐value < 0.02
43.2=
212r
nrt−
−=
243.0122843.0
−
−
How can we do a randomiza-on test for a mean?
Example: Mean Body Temperature
Data: A random sample of n=50 body temperatures.
Is the average body temperature really 98.6oF?
BodyTemp96 97 98 99 100 101
BodyTemp50 Dot Plot
H0:μ=98.6 Ha:μ≠98.6
n = 50 𝑥 =98.26 s = 0.765
Data from Allen Shoemaker, 1996 JSE data set ar6cle
Key idea: Generate samples that are (a) consistent with the null hypothesis (b) based on the sample data.
How to simulate samples of body temperatures to be consistent with H0: μ=98.6?
Randomiza6on Samples How to simulate samples of body temperatures to be consistent with H0: μ=98.6?
1. Add 0.34 to each temperature in the sample (to get the mean up to 98.6).
2. Sample (with replacement) from the new data.
3. Find the mean for each sample (H0 is true). 4. See how many of the sample means are as
extreme as the observed 𝑥 =98.26.
Let’s try it on
StatKey.
Playing with StatKey!
See the orange pages in the folder.
Choosing a Randomiza6on Method A=Sleep 14 18 11 13 18 17 21 9 16 17 14 15 mean=15.25 B=Caffeine 12 12 14 13 6 18 14 16 10 7 15 10 mean=12.25
Example: Word recall
Op6on 1: Randomly scramble the A and B labels and assign to the 24 word recalls.
H0: μA=μB vs. Ha: μA≠μB
Op6on 2: Combine the 24 values, then sample (with replacement) 12 values for Group A and 12 values for Group B.
Reallocate
Resample
Ques6on
In Intro Stat, how cri6cal is it for the method of randomiza6on to reflect the way data were collected? A. Essen6al B. Rela6vely important C. Desirable, but not impera6ve D. Minimal importance E. Ignore the issue completely
How do we assess student understanding of these methods (even on in-‐class exams without computers)?
See the blue pages in the folder.
Connec6ng CI’s and Tests
Randomiza6on body temp means when μ=98.6
xbar98.2 98.3 98.4 98.5 98.6 98.7 98.8 98.9 99.0
Measures from Sample of BodyTemp50 Dot Plot
97.9 98.0 98.1 98.2 98.3 98.4 98.5 98.6 98.7bootxbar
Measures from Sample of BodyTemp50 Dot Plot
Bootstrap body temp means from the original sample
What’s the difference?
Fathom Demo: Test & CI
Sample mean is in the “rejec6on region”
⟺ Null mean is outside the confidence interval
What about Tradi6onal Methods?
Transi6oning to Tradi6onal Inference
AFTER students have seen lots of bootstrap distribu6ons and randomiza6on distribu6ons…
Students should be able to • Find, interpret, and understand a confidence
interval • Find, interpret, and understand a p-‐value
slope (thousandths)-60 -40 -20 0 20 40 60
Measures from Scrambled RestaurantTips Dot Plot
r-0.6 -0.4 -0.2 0.0 0.2 0.4 0.6
Measures from Scrambled Collection 1 Dot Plot
Nullxbar98.2 98.3 98.4 98.5 98.6 98.7 98.8 98.9 99.0
Measures from Sample of BodyTemp50 Dot Plot
Diff-4 -3 -2 -1 0 1 2 3 4
Measures from Scrambled CaffeineTaps Dot Plot
xbar26 27 28 29 30 31 32
Measures from Sample of CommuteAtlanta Dot Plot
Slope :Restaurant 6ps Correla6on: Malevolent uniforms
Mean :Body Temperatures Diff means: Finger taps
Mean : Atlanta commutes
phat0.3 0.4 0.5 0.6 0.7 0.8
Measures from Sample of Collection 1 Dot PlotPropor6on : Owners/dogs
What do you no6ce? All bell-‐shaped distribu6ons!
Bootstrap and Randomiza-on Distribu-ons
The students are primed and ready to learn about the normal distribu-on!
Transi6oning to Tradi6onal Inference
Confidence Interval: 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 ± 𝑧↑∗ ∙𝑆𝐸 Hypothesis Test: 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 −𝑁𝑢𝑙𝑙 𝑃𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟 𝑆𝐸
• Introduce the normal distribu6on (and later t)
• Introduce “shortcuts” for es6ma6ng SE for propor6ons, means, differences, slope…
z* -‐z*
95%
Confidence Intervals
Test sta6s6c
95%
Hypothesis Tests
Area is p-‐value
Confidence Interval: 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 ± 𝑧↑∗ ∙𝑆𝐸 Hypothesis Test: 𝑆𝑎𝑚𝑝𝑙𝑒 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 −𝑁𝑢𝑙𝑙 𝑃𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟 𝑆𝐸
Yes! Students see the general paaern and not just individual formulas!
Brief Technology Session Choose One!
R (Kari) Excel (Eric) Minitab (Robin) TI (Pay) More StatKey (Dennis)
(Your binder includes informaFon on using Minitab, R, Excel, Fathom, Matlab, and SAS.)
Student Preferences
Which way of doing inference gave you a better conceptual understanding of con;idence intervals and hypothesis tests?
Bootstrapping and Randomiza-on
Formulas and Theore-cal Distribu-ons
113 51 69% 31%
Student Preferences
Which way did you prefer to learn inference (con;idence intervals and hypothesis tests)?
Bootstrapping and Randomiza-on
Formulas and Theore-cal Distribu-ons
105 60 64% 36%
Simulation Traditional AP Stat 31 36
No AP Stat 74 24
Student Behavior • Students were given data on the second midterm and asked to compute a con;idence interval for the mean
• How they created the interval:
Bootstrapping t.test in R Formula
94 9 9 84% 8% 8%
A Student Comment " I took AP Stat in high school and I got a 5. It was mainly all equations, and I had no idea of the theory behind any of what I was doing. Statkey and bootstrapping really made me understand the concepts I was learning, as opposed to just being able to just spit them out on an exam.”
-‐ one of Kari’s students
Thank you for joining us!
More informa-on is available on www.lock5stat.com
Feel free to contact any of us with
any comments or ques-ons.
Please fill out the Minicourse evalua6on form at www.surveymonkey.com/s/JMM2013MinicourseSurvey