27
Hadley Wickham Stat310 Hypothesis tests Wednesday, 21 April 2010

24 tests

Embed Size (px)

Citation preview

Page 1: 24 tests

Hadley Wickham

Stat310Hypothesis tests

Wednesday, 21 April 2010

Page 2: 24 tests

1. Quiz

2. Final

3. Hypothesis tests

Wednesday, 21 April 2010

Page 3: 24 tests

2 hour take home

Due last day of exam period

Larger number of smaller questions like the homeworks

More info on Thursday

Final

Wednesday, 21 April 2010

Page 4: 24 tests

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

Page 5: 24 tests

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

Hypothesis

Wednesday, 21 April 2010

Page 6: 24 tests

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.

Suitcase

Wednesday, 21 April 2010

Page 7: 24 tests

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

Page 8: 24 tests

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

Page 9: 24 tests

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

Page 10: 24 tests

X̄n − µ

σ/√

n∼ Z

Xi iid, and n large (> 30):

.

X̄n − µ

S/√n

∼ Z.

Wednesday, 21 April 2010

Page 11: 24 tests

(n− 1)S2

σ2∼ χ2(n− 1)

X̄n − µ

σ/√

n∼ Z

X̄n − µ

s/√

n∼ tn−1

Xi ∼ Normal(µ,σ2)iid

Wednesday, 21 April 2010

Page 12: 24 tests

Others

Difference of normals

Sum of poisson

Sum of binomial

...

Wednesday, 21 April 2010

Page 13: 24 tests

What test statistic might you use? (What experiment might you conduct?)

What is the null distribution?

Suitcase

Wednesday, 21 April 2010

Page 14: 24 tests

What test statistic might you use?

What is its null distribution?

Grade difference

Wednesday, 21 April 2010

Page 15: 24 tests

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

Page 16: 24 tests

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!

P-value

Wednesday, 21 April 2010

Page 17: 24 tests

SuitcaseBackground radiation is Poisson(2)

If I measure the suitcase and record a 3, what’s the p -value? What if I record a 5?

What’s the probability it’s a bomb?

X P(X ≤ x)

0 0.14

1 0.41

2 0.68

3 0.86

4 0.95

5 0.98

X ∼ Poisson(2)

Wednesday, 21 April 2010

Page 18: 24 tests

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

Page 19: 24 tests

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

Page 20: 24 tests

Say is guilty

Say is innocent

Is guilty

Is innocent

CorrectFalse

acquittal

False conviction

Correct

Wednesday, 21 April 2010

Page 21: 24 tests

Your turn

Which type of error is more expensive/more costly/worse in the criminal justice system?

Wednesday, 21 April 2010

Page 22: 24 tests

Reject HO Accept HO

HO false

HO true

CorrectType II error

Type I error

Correct

Wednesday, 21 April 2010

Page 23: 24 tests

For a given test,

P(false conviction) = α = significance level

P(false acquittal) = β = power

What do think happens to β if you try to make α smaller?

Rates

Wednesday, 21 April 2010

Page 24: 24 tests

α↑ β↓α↓ β↑

Wednesday, 21 April 2010

Page 25: 24 tests

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

Page 26: 24 tests

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

Page 27: 24 tests

Next timeLast 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