Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing...

38
Hypothesis Testing Applied to population parameters by specifying H0 that contains a null value for the population parameter a value that would indicate a baseline, or that nothing of interest is happening: ―old news‖, ―no difference‖, etc. Based on a point estimate (sample statistic ), and assessing how unlikely to obtain this sample statistic if the null parameter value were correct .

Transcript of Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing...

Page 1: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Hypothesis Testing

Applied to population parameters by specifying H0 that

contains a null value for the population parameter—a

value that would indicate a baseline, or that nothing of

interest is happening: ―old news‖, ―no difference‖, etc.

Based on a point estimate (sample statistic), and

assessing how unlikely to obtain this sample statistic if the

null parameter value were correct.

Page 2: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example

According to MA 115 B1 Intro Survey, 52 out of

108 students reported feeling stressed at the

beginning of the semester.

What is the approximate probability to obtain the

sample proportion of 48% or lower, if the true

proportion of all students who feel stressed during

the semester is 85%?

Page 3: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Hypothesis Testing

Achieving statistical significance is equivalent to

rejecting the idea that the observed results are

plausible if the null value is correct, i.e., rejecting the

null hypothesis (H0) in a favor of alternative

hypothesis (Ha).

Ha does not specify any specific value for the

true population parameter.

Ha gives an open interval that may contain

possible values of the true parameter, but never

contains the null value.

Page 4: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Hypothesis Testing

H0: μ=μ0(p=p0)

Ha: μ>μ0(p>p0)

upper-sided

Ha: μ≠μ0(p≠p0)

two-sided

Ha: μ<μ0(p<p0)

lower-sided

Page 5: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

5 Basic Steps in Any Hypothesis Test

Step 1: Determine hypotheses (H0 and Ha).

Step 2: Verify necessary data conditions, and if met,

summarize the data into an appropriate test statistic.

Step 3: Assuming the null (H0) hypothesis is true, find either

Rejection Rule (region or the p-value).

Step 4: Decide whether or not the result is statistically

significant based on Rejection Rule.

Step 5: Report the conclusion in the context of the problem

(question of interest).

Page 6: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

One Sample Hypothesis

Test for Population Mean

Test

Scenario

Data Population

Parameter

Sample

Statistics

Response Explan

atory

Variable

Populati

on Mean

1

Sample

Numerical

(Age, Price)

____

Can we claim that the average GPA of all BU graduates is higher than

3.0?

Page 7: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example: Testing Mean

Systolic Blood Pressure

A large, national study conducted in 2003 reported

that the mean systolic blood pressure for males

aged 50 was 130 with std =15.

2004, an investigator hypothesized that due to

increased stress in the work-place, faster-paced

lifestyles, and poorer nutritional habits, average

systolic blood pressure have increased.

Page 8: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example: Testing Mean

Systolic Blood Pressure

In 2003, systolic blood pressure for males aged 50

had mean=130 with std =15.

Have average systolic blood pressure increased in

2004, on average?

Step 1: H0: μ = 130 (―no change‖)

Ha:μ>130 (i.e., mean blood pressure increased)

Page 9: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example: Testing Mean

Systolic Blood Pressure

Have average systolic blood pressure increased in

2004, on average? (2003, mean=130 with std =15)

Step 2:

Select a random sample from population of interest (n

= 108 males aged 50 in 2004)

Record the systolic blood pressure on each male

Generate a point estimate for the population mean μ

Compute an appropriate test statistic

Page 10: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example: Testing Mean

Systolic Blood Pressure

Have average systolic blood pressure increased in

2004, on average? (n=108, mean=130 , std =15)

Step 2: Consider the following cases: (H0:μ =130)

1.

2.

3.

130X

130150X

130135X

)130|135()_0|135( XPtrueHXP

)150|150()_0|150( XPtrueHXP

Page 11: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Critical Value

If the sample mean is less than the critical

value, we will conclude that H0 is true (e.g.,

μ = 130)

If sample mean is greater than the critical

value, we will conclude that Ha is true (e.g.,

μ >130)

Page 12: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Test Statistic

Instead of determining critical values for sample mean

(specific to each application), we use the CLT to

standardize and produce a z-score:

Assuming H0 is true Z ~ N(0,1):

Z is close to zero then H0 is most likely true.

Z is large, then H1 is most likely true

Page 13: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Test Statistic

Have average systolic blood pressure increased in

2004, on average? (n=108, mean=130 , std =15)

Step 2:

Compute an appropriate test statistic

Page 14: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Appropriate Test Statistics

Page 15: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Decision/Rejection Rule

Step 3: Assuming H0 is true, how likely is

Using CLT:

Similarly:

Page 16: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Rejection Rule

Step 3:

Is set up a rule reject H0 if Z> 1,

α = P(Type I error) =0.1587

Is set up a rule reject H0 if Z> 2,

α = P(Type I error) =0.0228

Better to fix α in advance!

Page 17: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Rejection Rule (Table 5.4)

Page 18: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Rejection Rule

Say α=0.05, then we have to

find such point A, such that

P(Z≥Z1-α) =0.05, therefore

Z1-α =1.645.

Rejection Rule is given by:

Reject Ho if Z≥ 1.645,

and fail to reject H0 if Z< 1.645.

Page 19: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Rejection Rule

H0: μ=μ0(p=p0)

Ha: μ>μ0(p>p0)

upper-sided

Reject H0

if Z≥ Z1-α

(t≥ t1-α, df)

Ha: μ≠μ0(p≠p0)

two-sided

Reject H0

if Z≥ Z1-α/2 (t≥ t1-α/2,df)

or Z≤- Z1-α/2 (t≤- t1-α/2,df )

Ha: μ<μ0(p<p0)

lower-sided

Reject H0

if Z≤- Z1-α

(t≤- t1-α,df)

Page 20: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Decision

Step 4: The final step in the test of

hypothesis is to compare the test statistic to

the decision rule to draw a conclusion.

The test statistic falls in the rejection region

and therefore we reject H0 because

Test statistic (3.46) > critical value (1.645)

Page 21: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Conclusion

Step 5: Conclusion:

Based on the sample of n=108 male, there

is significant evidence, at level α = 0.05, to

conclude that the mean systolic blood

pressure for males aged 50 in 2004 has

increased from 130.

Page 22: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

P-value

Step 4: We rejected H0 because

Test statistic (3.46) > critical value (1.645)

Option 2: Compute p-value

p-value is the probability of getting a test

statistic as extreme or more extreme (in the

direction of Ha) than the observed value of the

test statistic, assuming the null hypothesis(H0)

is true.

Page 23: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

P-value

p-value = P(test stat is more extreme|H0 is true)

From Step 1: H0: μ = 130 (―no change‖)

Ha:μ>130 (i.e., mean blood pressure increased)

From Step 3: Test Statistic

p-value = P(Z≥ 3.46| H0 is true=> Z~N(0,1))=

= 0.0001

Page 24: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

P-value

If the p-value ≤ α , then the result IS statistically

significant, the decision is to reject H0.

If the p-value >α , then the result IS NOT

statistically significant, the decision is to fail to

reject H0.

p-value = P(Z≥ 3.46| H0 is true=> Z~N(0,1))=

= 0.0001<0.05 , so reject H0

Page 25: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

A National Sleep Foundation survey found that

college/university-aged students get an average of 6.8

hours of sleep each night.

Sleep deprivation is common in college freshmen.

At the beginning of the fall semester, based on a sample of

n=108 students in MA 115, we estimated mean =7.21

hours with the std=1.12 hours.

Based on the data, is there significant evidence (at α =5%)

to conclude that students tend to sleep more at the

beginning of school year?

Page 26: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

A National Sleep Foundation survey found that

college/university-aged students get an average of 6.8

hours of sleep each night.

Based on the data (108 MA 115 students), is there

significant evidence (at α =5%) to conclude that students

tend to sleep more at the beginning of school year?

Step 1:

Parameter: μ = _____________________________

H0: Ha: Significance level α = ______

Page 27: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

A National Sleep Foundation survey found that

college/university-aged students get an average of 6.8

hours of sleep each night.

Based on the data (108 MA 115 students), is there

significant evidence (at α =5%) to conclude that students

tend to sleep more at the beginning of school year?

Step 1:

Parameter: μ = number of hours of sleep for students

H0: μ = 6.8 Ha: μ > 6.8 Significance level α = 0.05

Page 28: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

H0: μ = 6.8 Ha: μ > 6.8 Significance level α = 0.05

At the beginning of the fall semester, based on a sample of

n=108 students in MA 115, we estimated sample mean

=7.21 hours with the s=1.12 hours.

Step 2: Compute appropriate test statistic

Page 29: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Appropriate Test Statistics

Page 30: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

H0: μ = 6.8 Ha: μ > 6.8 Significance level α = 0.05

At the beginning of the fall semester, based on a sample of

n=108 students in MA 115, we estimated sample mean

=7.21 hours with the s=1.12 hours.

Step 2: Compute appropriate test statistic

Page 31: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

Step 3: Assuming the null (H0) hypothesis is true, define

decision rule (or rejection region)

The decision rule for any hypothesis testing application

depends on three factors:

(1) Whether the test is an upper-, lower-, or two-tailed test

(2) The level of significance:

(3) The form of the test statistic:

Page 32: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Rejection Rule

H0: μ=μ0(p=p0)

Ha: μ>μ0(p>p0)

upper-sided

Reject H0

if Z≥ Z1-α

(t≥ t1-α, df)

Ha: μ≠μ0(p≠p0)

two-sided

Reject H0

if Z≥ Z1-α/2 (t≥ t1-α/2,df)

or Z≤- Z1-α/2 (t≤- t1-α/2,df )

Ha: μ<μ0(p<p0)

lower-sided

Reject H0

if Z≤- Z1-α

(t≤- t1-α,df)

H0: μ = 6.8 Ha: μ > 6.8 Significance level α = 0.05

Page 33: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

Step 3: Assuming the null (H0) hypothesis is true, define

decision rule (or rejection region)

The decision rule for any hypothesis testing application

depends on three factors:

(1) Whether the test is an upper-, lower-, or two-tailed test

(2) The level of significance: α =0.05

(3) The form of the test statistic: Z statistic.

The decision rule: Reject H0 if Z ≥ 1.645 Do not

reject Ho if Z < 1.645

Page 34: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

A National Sleep Foundation survey found that

college/university-aged students get an average of 6.8

hours of sleep each night.

Based on the data, is there significant evidence (at α =5%)

to conclude that students tend to sleep more at the

beginning of school year?

Step 4: We reject H0 (μ = 6.8 ) because 3.79 > 1.645.

Page 35: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Example (Student Sleep Deprivation)

A National Sleep Foundation survey found that

college/university-aged students get an average of 6.8

hours of sleep each night.

Based on the data, is there significant evidence (at α =5%)

to conclude that students tend to sleep more at the

beginning of school year?

Step 5: Based on the sample of n=108 students, there is

significant evidence, at level α = 0.05, to conclude that

students tend to sleep more at the beginning of school year,

on average.

Page 36: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Facts:

In 1997 the University of Minnesota found that students

who went to school at 7:15 a.m. got higher grades than

those who went to school at 8:40 a.m.

Randy Gardner holds the scientifically documented record

for not sleeping for 264 hours ~eleven days without using

stimulants of any kind

Never scientifically verified: Thai Ngoc, born 1942,

claimed in 2006 to have been awake for 33 years or 11,700

nights.

Page 37: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Facts:

Caffeine is often used over short periods to

increase alertness and counteract the effects of

sleep deprivation; however, caffeine is less

effective if taken routinely.

Other strategies recommended by the American

Academy of Sleep Medicine include prophylactic

sleep, daytime naps, increase in night sleep time.

Page 38: Hypothesis Testingpeople.missouristate.edu/songfengzheng/Teaching/... · Hypothesis Testing Achieving statistical significance is equivalent to rejecting the idea that the observed

Types of Errors

ProbabilityType of ErrorDecisionTruth

H0 True

Reject H0TYPE I Error

P(TYPE I)=α

Fail to Reject H0

NO Error 1-α

Ha True

Reject H0 NO Error power=1-β

Fail to Reject H0

TYPE II Error

P(TYPE II)=β