1 tests of hypotheses. 2 statistical hypothesis statistical hypothesis- statement about a feature of...

53
1 Tests of Hypotheses

Upload: henry-rogers

Post on 25-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

1

Tests of Hypotheses

Page 2: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

2

Statistical hypothesis

Statistical hypothesis-Statement about a feature of the population (e.g. – the mean)

Examples:- Mean temperature of healthy adults is 98.6°F (37°c).- A certain medication contains a mean of 245 ppm of a particular chemical.- Mean number of people that enter a certain restaurant in a day is 125.

Page 3: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

3

Example – soft drink bottles

A firm that produces a certain soft drink prints on each bottle that it contains 24 oz of drink. It has been suspected that the mean amount per bottle is less than 24 oz . In order to examine this claim, a sample of 100 bottles has been taken and the mean amount per bottle was found to be 23.4 oz.Assume that the standard deviation of the contents of the drink in the bottles is σ=3 oz.Is this an indication that the mean amount of drink in a bottle is less than 24 oz?

Page 4: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

4

Set hypotheses:

Two types of hypotheses:

H0 - the null hypothesis

Common beliefs, the claims that are assumed to be true up-to-dateH0 - Mean contents of soft drink bottle, μ, is 24 oz

(μ=24)

H1 - the alternative hypothesis

Alternative claims that come to challenge the common beliefsH1 – mean contents of soft drink bottle, μ, is less than 24 oz

(μ<24)

Page 5: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

5

Use the sample results to test the hypotheses

Page 6: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

6

If is (i) small enough

(ii) large enough

we will reject H0.

X

H0: μ=24

H1: μ<24

Sample results: 4.23X

Page 7: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

7

How likely are we to observe such result from a population with mean μ=24?

μ=24 oz

The distribution of X

4.23X

?)4.23( Xp

3.0

100

3,24~ then 24, If NX

Page 8: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

8

?)4.23( Xp

3.0

100

3,24~ that recall NX

0228.0)2(

3.0

244.23)4.23(

Zp

ZpXp

We are not very likely to observe such result from a population with μ=24 (prob=0.028)

Page 9: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

9

Test statistic

Z = -2

is an example of a test statistic

It measures the distance of the sample results from what is expected if H0 is true.

n

XZ

Page 10: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

10

μ=24 oz

2

4.23

ZorX

0.0228

Is the value Z=-2 unusual under H0?

There is only 0.0228 chance of getting values smaller than Z=-2 if H0 is true

Page 11: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

11

P-value

The probability of getting an outcome as extreme or more extreme than the observed outcome.

“Extreme” – far from what we would expect if H0 were true.

The smaller the p-value, the stronger the evidence against H0.

Page 12: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

12

Level of significance

α – significance level.

It is the chance we are ready to take for rejecting H0 while in fact H0 is true

if p-value≤ α, we say that we reject H0 at the α significance level.

Typically, α is taken to be 0.05 or 0.01

Page 13: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

13

In the bottles example:

If we required a significance level of α=0.05 then we would reject H0

p-value=0.0228<0.05

However, if we required a significance level of α=0.01 then we would not reject H0

X

μ=24

2

4.23

ZorX

0.028

Page 14: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

14

Example – sales of coffee

Weekly sales of regular ground coffee at a supermarket have in the recent past varied according to a normal distribution with mean μ=354 units per week and standard deviation σ=33 units. The store reduces the price by 5%. Sales in the next three weeks are: 405, 378, and 411 units. Is this good evidence, at the 5% significance level, that average sales are now higher?

Hypotheses:

H0:

H1:

Sample mean:

μ=354

μ>354

3983

411378405

X

How far is from what we expect if H0 is true? X

Page 15: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

15

Test statistic:

P-value:p-value=probability of getting values that are more extreme than the test statistic if H0 is true:

p(Z≥2.31)=1-Ф(2.31)=1-0.9896=0.0104

Decision for α=0.05:P-value=0.0104< α

We reject H0:

There is evidence that sales have increased.

n

XZ

31.2

333

354398

μ=354

398X

Page 16: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

16

Example – systolic blood pressure

The national center for health statistics reports that the mean systolic blood pressure for males 35 to 44 years of ages is 128 and the standard deviation in the population is 15. The medical director of a large company looks at the records of 72 executives in this age group and finds that the mean systolic blood pressure in this sample is . Is this evidence that the company’s executives have a different mean blood pressure from the general population?

no difference from the general population: μ=128

μ≠128 (2 sided hypothesis)

07.126X

Hypotheses:

H0:

H1:

Page 17: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

17

Test statistic:

P-value:

p-value=probability of getting values that are more extreme than the test statistic:

p(Z≤-1.09)=0.1379

But our H1 hypothesis is two sided – we must also consider the probability that Z≥1.09

so p-value=2p(Z≤-1.09)=2(0.1379)=0.2758

n

XZ

09.1

7215

12807.126

Z=1.09Z=-1.09

0.1379

Page 18: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

18

Decision for α=0.05:

P-value=0.2758>0.05

we do not reject H0.

Therefore there is no strong evidence that executives differ from other men in their blood pressure

Page 19: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

19

General rules for test of Hypotheses about the mean

H0: μ=μ0 (known σ)

Test statistic:

H1: μ<μ0

P-value = p(Z≤z)

H1: μ>μ0

P-value = p(Z≥z)

H1: μ≠μ0

P-value = 2p(Z≥|z|)

n

XZ

Z

Z

|Z|

Page 20: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

20

Example – Obstetrics (branch of medicine concerned with birth of children)

The mean birth weight in the US is 120 OZ.Suppose that in a sample of 100 full-term live-born deliveries in a hospital in a low socio-economic status area:Suppose also that the standard deviation of birth weight is σ=24 OZ. Examine whether the birth weight in low socio-economic status area is lower than the rest of the population.

Hypotheses: H0: H1:

Test statistic:

μ=120

μ<120

OZ 115X

n

XZ

083.24.2

5

10024

120115

Page 21: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

21

P-value:Probability of getting values that are more extreme than the test statistic under H0.

p-value=p(Z≤-2.083)=0.0188

Decision for α=5%:P-value=0.0188<αReject H0.

There is evidence that mean birth-weight of babies in the low socio-economic status area is smaller than mean birth weight of other babies.

Decision for α=1%:P-value=0.0188>αDo not reject H0.

There is no evidence to suspect that mean birth-weight of babies in the low socio-economic status area is smaller then mean birth weight of other babies.

083.24.2

5

10024

120115

X

083.2Z

Page 22: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

22

Example – Nicotine

The nicotine content in cigarettes of a certain brand is normally distributed with mean ( in milligrams) μ and standard deviation σ=0.1. The brand advertises that the mean nicotine content of its cigarettes is 1.5, but measurements on a random sample of 100 cigarettes of this brand gave a mean . Is this evidence ,at the 1% significance level, that the mean nicotine content is actually higher than advertised?

Hypotheses: H0: H1:

Test statistic:

53.1X

μ=1.5μ>1.5

n

XZ

301.0

03.0

1001.0

5.153.1

Page 23: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

23

P-value:Probability of getting values that are more extreme than the test statistic under H0.

p(Z≥3)=1-p(Z<3)=1-0.9987=0.0013

Decision for α=1%:P-value=0.0013< αReject H0.

There is evidence that the mean nicotine content is higher than advertised

083.24.2

5

10024

120115

X

3Z

P-value=

Page 24: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

24

Example – body temperature

- Mean temperature of healthy adults=98.6°F (37°C)(found by Carl Wunderlich, German physician, 1868)

- In 1992, a random sample of n=50 gave

- Assume σ=0.67

Is there evidence, at the 0.01 significance level, to suspect that the mean temperature differ from 98.6°F?

Hypotheses: H0: H1:

23.98X

μ=98.6μ≠98.6

Page 25: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

25

Test statistic:

P-value:2p(Z>|-3.9|)=2(1-Ф(3.9))=2(0.00012)=0.00024

Decision for α=0.01:P-value=0.00024< α

We reject H0:

The is evidence to suspect that the mean temperature differ from 98.6

n

XZ

9.3

5067.

6.9823.98

3.9-3.9

Page 26: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

26

What is wrong with the following sets of Hypotheses?

H0:

H1: 5X5X

Answer: the hypotheses should be about μ !

Answer: the equal sign hypothesis should be in H0.

H0: μ<5H1: μ=5

H0: μ≠5H1: μ=5Answer: the equal sign hypothesis should be in H0.

H0: μ=5

H1: μ<5Answer: nothing is wrong

Page 27: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

27

Testing hypotheses using a confidence interval:

Example:A certain maintenance medication is supposed to contain a mean of 245 ppm of a particular chemical. If the concentration is too low, the medication may not be effective; if it is too high, there may be serious side effects. The manufacturer takes a random sample of 25 portions and finds the mean to be 247 ppm. Assume concentrations to be normal with a standard deviation of 5 ppm. Is there evidence that concentrations differ significantly (α=5%) from the target level of 245 ppm?

Hypotheses:

H0: μ=245

H1: μ≠245

Page 28: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

28

First, lets examine the Z test statistic:

Test statistic:

P-value:

2P(Z>2)=2(0.0228)=0.0456

Decision at 5% significance level:

P-value>α reject H0

The concentration differs from 245

n

XZ

2

255

245247

Page 29: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

29

Now, examine the hypotheses using a confidence interval

α =0.05 confidence level is 1- α = 95%

95% CI:

[245.04 , 248.96]

We are 95% certain that the mean concentration is between 245.04 and 248.96.

Since 245 is outside this CI - reject H0.

The concentration differs from 245

n

zX

975. 25

596.1247

)1(96.1247

Page 30: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

30

H0: μ=μ0

H1: μ≠μ0

If μ0 is outside the confidence interval, then we reject the null hypothesis at the α significance level.

Note: this method is good for testing two-sided hypotheses only

[ confidence interval]

Examine the hypotheses using a confidence interval

μ0

Page 31: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

31

ExampleSuppose a claim is made that the mean weight μ for a population of male runners is 57.5 kg. A random sample of size 24 yields . [σ is known to be 5 kg].

Based on this, test the following hypotheses:

H0: μ=57.5

H1: μ≠57.5

Answer using:

a) A Z test statistic

b) A confidence interval

60X

Page 32: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

32

a)

Test statistic:

P-value:

2P(Z>2.45)=2(1-.9929)=2(.0071)=.0142

Decision at 5% significance level:

P-value<α reject H0

Conclusion:

Mean weight differs from 57.5

n

XZ

45.2

245

5.5760

Page 33: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

33

b) α =0.05 confidence level is 1- α = 95%

95% CI:

[58 , 62]

57.5 is outside this CI - reject H0.

Mean weight differs from 57.5

question?: Would you reject H0: μ=59 vs. H1: μ≠59?

No, because 59 is in the interval [58, 62]

n

zX

975. 24

596.160

)02.1(96.160

Page 34: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

34

Example

In a certain university, the average grade in statistics courses is 80, and σ=11. A teacher at that university wanted to examine whether her students received higher grades than the rest of the stat classes. She took a sample of 30 students and recorded their grades

hypotheses:H0:μ=80H1:μ>80

data are:

mean: 03.85X

95 100 82 76 75 83 75 96 75 98 79 80 79 75 100 91 81 78 100 72 94 80 87 100 97 91 70 89 99 54

Page 35: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

35

Test statistic:

P-value:P(Z>2.51)=1-0.9940=0.006

Decision at 5% significance level:P-value<α reject H0

conclusion:The grades are higher than 80

n

XZ

51.2

3011

8003.85

Page 36: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

36

Testing hypotheses about the mean when σ is unknown

Page 37: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

37

What happens when σ is unknown?

We can estimate it from the sample:

When the standard deviation is estimated from the sample, the test statistic is not Z:

1

)(...)()( 222

21

n

xxxxxxS n

1

)(1

2

n

xxS

n

ii

Or:

)1,0(~ N

n

XZ

)1(~

nt

nSX

t

Page 38: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

38

t-distribution

• Symmetric around zero• Bell-shaped• Has wider tails than those of Z

t(n-1)

Z

0

Page 39: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

39

t(2)

Zt(9)

t-distribution becomes more similar to Z as n increases:

Page 40: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

40

Example

During a recent water shortage in a southern city, the water company randomly sampled residential water consumption on a daily basis. A random sample of 20 residents revealed:

, S=24.3 gallons.

Suppose the mean water consumption before the water shortage was 250 gallons. Test, at the 5% significance level, whether there was a decrease in the mean daily consumption.

Hypotheses:

H0:

H1:

7.223X

μ=250

μ<250

Page 41: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

41

Test statistic:

P-value:

P(t(19)<-4.84) = t – table

=P(t(19)>4.84)

p-value < 0.0025

Decision for α=0.05:P-value<0.05 Reject the null hypothesis

Conclusion:The daily consumption decreased below 250 gallons.

)19(~ t

nSX

t

84.4

203.24

2507.223

t

-4.84

Page 42: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

42

Example

The mean age of all CEO’s for major corporations in the U.S was 48 years in 1991. A random sample of 25 CEO’s taken recently from major corporations showed that years, s=5 years. Assume that the age of CEO’s of major corporations have an approximate normal distribution. Would you conclude, at the 5% significance level, that the current mean age of all CEO’s of major corporations is not equal to 48?

46X

Page 43: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

43

Hypotheses:

H0:H1:

Test statistic:

P-value: 2P(t(24)<-2) = 2P(t(24)>2) t – table =2(0.025 to 0.05)= =0.05 to 0.1

Decision for α=0.05:P-value>0.05 Do not reject the null hypothesis

Conclusion:The mean age of CEO’s of major companies is not different from 48

nSX

t

2

255

4846

-2 2

μ=48

μ≠48

Page 44: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

44

Example

The police department will be eligible for a new hire if they can produce convincing evidence that their response times to non-emergency crime call average more than 15 minutes. A random sample of 41 calls averaged 17 minutes, with standard deviation 6 minutes. Carry out a test and decide if they are eligible for the new hire.

Page 45: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

45

Hypotheses:

H0:H1:

Test statistic:

P-value:P(t(40)>2.13) = =( 0.01 to 0.025)= 0.01<p-value<0.025

Decision for α=0.05:

P-value<0.05 Reject H0

Conclusion:The mean response time to non-emergency calls is greater than 15 – they are eligible for the new hire.

nSX

t

13.2

416

1517

2.13

μ=15

μ>15

Page 46: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

46

back to question1

back to question2

Page 47: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

47

Practice the t-table

P(t(20)>1.325)=

P(t(10)>2.870)=

P(t(10)<-2.780)=

P(t(10)>3.6)=

P(t(10)<-3.6)=

P(t(25)>2.51)=?

P(t(9)<-2)=?

P(t(19)<-4.84)

0.1

0.0083

0.0083

<0.0025

<0.0025

0.0083< P(t(25)>2.51) < 0.01

0.025< P(t(9)<-2) < 0.05

<0.0025

Page 48: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

48

A confidence interval to the

mean when σ is unknown

n

sntX )1(

21

nzX

2

1When σ is

known:

When σ is unknown:

Page 49: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

49

Testing hypotheses about the mean using confidence interval

If μ0 is outside the CI reject H0

Confidence interval

Page 50: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

50

T-test with MinitabExample:

Most people believe that the mean age at which babies start to walk is one year. A A researcher thought that the mean age is higher. She took a sample of 10 babies and documented the age (in months) at which they started to walk.

The data are:

Examine the researcher’s claim (α=5%).

mean: SD:1.633

12 11 13 14 15 13 12 11 16 13

00.13X

Page 51: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

51

hypotheses:

H0:μ=12

H1:μ>12

Test statistic:

P-value:P(t(9)>1.94)=0.025<p.v<0.05

Decision at 5% significance level:

P-value < 0.05 reject H0

conclusion:The mean age at which babies start to walk is higher than 12 months

nsX

t

94.1

10633.1

1213

Page 52: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

52

Flow diagram for testing hypotheses about the mean

σ known?

YesNo

)1(~

nt

nsX

t

)1,0(~ N

n

Xz

Page 53: 1 Tests of Hypotheses. 2 Statistical hypothesis Statistical hypothesis- Statement about a feature of the population (e.g. – the mean) Examples: - Mean

53

Flow diagram for testing hypotheses about the mean

σ known?

YesNo

)1(~

nt

nsX

t

)1,0(~ N

n

Xz

Is the sample VERY large?

)1,0(~ N

n

Xz

YesNo