1. Stat310 Hypothesis tests
Hadley Wickham
Wednesday, 21 April 2010
2. 1. Quiz
2. Final
3. Hypothesis tests
Wednesday, 21 April 2010
3. Final
2 hour take home
Due last day of exam period
Larger number of smaller questions like
the homeworks
More info on Thursday
Wednesday, 21 April 2010
4. 1. Write down Ho and Ha
(positions of defence and prosecution)
2. Figure out good test statistic
(what numeric summary?)
3. Work out null distribution
(distribution of innocents)
4. Calculate p-value by comparing actual value
to null distribution (what proportion of true
innocents look more guilty than the suspect)
5. Reject Ho if p-value smaller than cutoff
Wednesday, 21 April 2010
5. Hypothesis
Null hypothesis = Ho
Alternative hypothesis = Ha
Hint: because we need to be able to
calculate the null distribution, the null
hypothesis will always be of the form:
Some parameter = some value
μ=0
Wednesday, 21 April 2010
6. Suitcase
Does this suitcase contain a radioactive
bomb? Construct Ho and Ha.
Let R be the background radiation
measured over a minute. R ~ Poisson(2).
Let S be the radiation from the suitcase.
Construct a more precise Ho and Ha.
Wednesday, 21 April 2010
7. Grade difference
I’m interested in whether or not there is a
difference between this years average
stat310 grade and last years. Construct
Ho and Ha.
If grades are normally distributed both
years, can you rewrite the null hypothesis
to be more precise? What other
assumptions do you need?
Wednesday, 21 April 2010
8. Alternative
Can be one-sided or two-sided
Basically comes down to the question of
what more guilty means.
For the suitcase: guilty means higher
radiation.
For course grades: guilty means positive
or negative difference.
Wednesday, 21 April 2010
9. 1. Write down Ho and Ha
(positions of defence and prosecution)
2. Figure out good test statistic
(what numeric summary?)
3. Work out null distribution
(distribution of innocents)
4. Calculate p-value by comparing actual value
to null distribution (what proportion of true
innocents look more guilty than the suspect)
5. Reject Ho if p-value smaller than cutoff
Wednesday, 21 April 2010
10. Xi iid, and n large (> 30):
¯n − µ .
X
√ ∼Z
σ/ n
¯n − µ .
X
√ ∼Z
S/ n
Wednesday, 21 April 2010
11. iid 2
Xi ∼ Normal(µ, σ )
(n − 1)S2
2
∼ χ (n − 1)
2
σ
X ¯n − µ
√ ∼Z
σ/ n
X ¯n − µ
√ ∼ tn−1
s/ n
Wednesday, 21 April 2010
12. Others
Difference of normals
Sum of poisson
Sum of binomial
...
Wednesday, 21 April 2010
13. Suitcase
What test statistic might you use?
(What experiment might you conduct?)
What is the null distribution?
Wednesday, 21 April 2010
14. Grade difference
What test statistic might you use?
What is its null distribution?
Wednesday, 21 April 2010
15. 1. Write down Ho and Ha
(positions of defence and prosecution)
2. Figure out good test statistic
(what numeric summary?)
3. Work out null distribution
(distribution of innocents)
4. Calculate p-value by comparing actual value
to null distribution (what proportion of true
innocents look more guilty than the suspect)
5. Reject Ho if p-value smaller than cutoff
Wednesday, 21 April 2010
16. P-value
Standardised measurement of evidence.
Low p-value = low probability of innocent
looking this guilty = reject the null
High p-value = high probability of
innocent looking this guilty = don’t reject
Don’t need to know anything else about
the test!
Wednesday, 21 April 2010
17. Suitcase
X ∼ Poisson(2)
Background radiation is X P(X ≤ x)
Poisson(2) 0 0.14
If I measure the suitcase 1 0.41
and record a 3, what’s the p
2 0.68
-value? What if I record a
5? 3 0.86
What’s the probability it’s a 4 0.95
bomb? 5 0.98
Wednesday, 21 April 2010
18. Course grades
Assume for simplicity there were 100
students both years, and the variance of
the course grade was 80.
What would the distribution of the test
statistic be?
Wednesday, 21 April 2010
19. 1. Write down Ho and Ha
(positions of defence and prosecution)
2. Figure out good test statistic
(what numeric summary?)
3. Work out null distribution
(distribution of innocents)
4. Calculate p-value by comparing actual value
to null distribution (what proportion of true
innocents look more guilty than the suspect)
5. Reject Ho if p-value smaller than cutoff
Wednesday, 21 April 2010
20. Say is Say is
guilty innocent
False
Is guilty Correct
acquittal
False
Is innocent Correct
conviction
Wednesday, 21 April 2010
21. Your turn
Which type of error is more expensive/
more costly/worse in the criminal justice
system?
Wednesday, 21 April 2010
22. Reject HO Accept HO
Type II
HO false Correct
error
Type I
HO true Correct
error
Wednesday, 21 April 2010
23. Rates
For a given test,
P(false conviction) = α = significance level
P(false acquittal) = β = power
What do think happens to β if you try to
make α smaller?
Wednesday, 21 April 2010
25. Cut off
Choose cut-off based on rate of false
convictions.
If you want a 5% rate of false convictions,
reject Ho if the p-value is less than 0.05.
Can work out power.
Wednesday, 21 April 2010
26. Connection to
confidence intervals
If you construct a 90% confidence
interval, and it doesn’t include the
parameter until the null, then the p-value
must be > 1 - 0.9 = 0.1.
If the p-value is 0.08, then a 92% or
greater confidence interval would include
the null parameter, and a smaller
confidence interval would not.
Wednesday, 21 April 2010
27. Next time
Last notes on testing.
More info about the final and study
sessions.
Opportunity for feedback.
Why statistics is awesome and you should
do more.
Class party!
Wednesday, 21 April 2010