51
Hypothesis Testing for Continuous Variables Yuantao Hao 19th,Otc., 2009 Chapter4

Chapter 4(2) Hypothesisi Testing

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Chapter 4(2) Hypothesisi Testing

Hypothesis Testing for

Continuous Variables

Yuantao Hao

19th,Otc., 2009

Chapter4

Page 2: Chapter 4(2) Hypothesisi Testing

We have learned:

Basic logic of hypothesis testing

Main steps of hypothesis testing

Two kinds of errors

One-side & two-side test

One-sample t test

Page 3: Chapter 4(2) Hypothesisi Testing

4.3

The t Test for Data under

Randomized Paired Design

Page 4: Chapter 4(2) Hypothesisi Testing

4.3 The t Test for Data under Randomized Paired Design

Example 4.2 The weights (kg) of 12

volunteers were measured before and

after a course of treatment with a “new

drug” for losing weight. The data is given

in Table 4.1. Please evaluate the

effectiveness of this drug.

Page 5: Chapter 4(2) Hypothesisi Testing

Table 4.1 The data observed in a study of weight losing

Weight (kg) No.

Pre-treatment (X1) Post-treatment (X2)

Difference

d=X1-X2

1 101 100 1

2 131 136 -5

3 131 126 5

4 143 150 -7

5 124 128 -4

6 137 126 11

7 126 116 10

8 95 105 -10

9 90 87 3

10 67 57 10

11 84 74 10

12 101 109 -8

∑ d=16

Page 6: Chapter 4(2) Hypothesisi Testing

Solution:

0:0 dH

0:1 dH

05.0

Page 7: Chapter 4(2) Hypothesisi Testing

58.01291.7

33.1

/

0

nS

dt

d

11112 P >0.50

Page 8: Chapter 4(2) Hypothesisi Testing

4.4

The Tests for Comparing Two Means

Based on Two Groups of Data under

Completely Randomized Design

Page 9: Chapter 4(2) Hypothesisi Testing

4.4 The t test for Comparing Two Means

About this design:

1. The individuals are randomly divided into two

groups which correspond to two treatments

respectively;

2. The two groups are randomly selected from

two populations respectively.

Page 10: Chapter 4(2) Hypothesisi Testing

Example 4.3

Assume the red cell counts of healthy

male residents and healthy female

residents of certain city follow two

normal distributions respectively, of

which the population means are

different and population standard

deviations are equal.

Page 11: Chapter 4(2) Hypothesisi Testing

There are two random samples drawn from the

two populations respectively, of which the sample

sizes, sample means and sample standard

deviations are ;

; .

It is expected to estimate the 95% confidence

interval for the difference of average red cell

counts between healthy male and female

residents.

15,20 21 nn 18.4,66.4 21 xx

45.0,47.0 21 ss

Page 12: Chapter 4(2) Hypothesisi Testing

Solution I t has been known that the sample variance f or males and

f emales are: 21s =(0.47)2=0.2209,

22s =(0.45)2=0.2025.

They are f airly closed each other so that the two population variances could be regarded as equal.

2131.021520

)45.0)(115()47.0)(120( 222

cs

3321520

Given 05.0 , check up the table f or t distribution, the two-side

critical value 05.0t =2.034.

Page 13: Chapter 4(2) Hypothesisi Testing

)15

1

20

1(2131.0034.2)18.466.4()

11()(

21

221

nnstxx c

16.0 and 80.0)1577.0(034.248.0

Therefore, the 95% confi dence interval f or the diff erence of average red cell counts between healthy male and f emale residents is (0.16, 0.80) (1012/ L).

Page 14: Chapter 4(2) Hypothesisi Testing

Question:

Please judge whether the population means of

males and females are equal or not.

210 : H

211 : H

Page 15: Chapter 4(2) Hypothesisi Testing

4.4.1 Equal Variances

2

11

21

222

2112

nn

SnSnSc

dist. ~

)11

(

)(

21

2

21 t

nnS

XXt

c

221 nn

Page 16: Chapter 4(2) Hypothesisi Testing

Solution:

04.3

15/120/12131.0

18.466.4

t

3321520221 nn

P< 0.01

Page 17: Chapter 4(2) Hypothesisi Testing

4.4.2 Unequal Variances

2221

21

21

// nSnS

XXt

21

2211'

ww

twtwt aaa

2222 / nSw

12

11 / nSw

Satterthwaite’s method

Page 18: Chapter 4(2) Hypothesisi Testing

Example 4.4 n1=10 patients and n2=20 healthy

people are randomly selected and measured for a

biochemical index. The mean and standard

deviation of the group of patients are =5.05

and S1=3.21, and that of the group of healthy

people are =2.72 and S2=1.52.

Please judge whether the two population means

are equal or not.

1X

2X

Page 19: Chapter 4(2) Hypothesisi Testing

Solution:

18.2

20/52.110/21.3

72.205.522

t

24.2

2052.1

1021.3

09.22052.1

26.21021.3

22

22

'05.0

t

P> 0.05

Page 20: Chapter 4(2) Hypothesisi Testing

4.5

The F-Test for Equal Variances of

Two Groups of Data under

Completely Randomized Design

Page 21: Chapter 4(2) Hypothesisi Testing

4.5 The F-Test for Equal Variances of Two Groups

22

210 : H

22

210 : H

Page 22: Chapter 4(2) Hypothesisi Testing

.~/

/22

22

21

21 distFS

S

1=n1-1, 2=n2-1

.~22

21 distFS

SVR

Page 23: Chapter 4(2) Hypothesisi Testing

21

12

,,

',,

1

F

F

Page 24: Chapter 4(2) Hypothesisi Testing

The larger variance is always taken as the

numerator of the statistic VR for convenience.

Thus, to a two-side test, given , one may

use /2 to find the upper critical value F/2 of

the F distribution, and if the current value of

VR is greater than or equal to F/2 , then P≤

, otherwise, P > ;

Page 25: Chapter 4(2) Hypothesisi Testing

Returning to Example 4.3, where

VR=1.09 , 1=19 , 2=14. Let =0.10 ,

the two-side critical value of F

distribution is F0.10/2=F0.05=2.40. Since VR

< F0.05, not reject , hence the there is

no enough evidence to say that the two

population variances are not equal.

0H

Page 26: Chapter 4(2) Hypothesisi Testing
Page 27: Chapter 4(2) Hypothesisi Testing

4.6.1

The Z-test for the population probability

of binomial distribution (large n)

Page 28: Chapter 4(2) Hypothesisi Testing

4.6.1 The Z-test for the population probability

),(~ nBX

))1(,(~ nnNX

))1(

,(~n

Nn

XP

n5

n(1-)5

Page 29: Chapter 4(2) Hypothesisi Testing

4.6.1.1 One sample

Example 4.7 150 physicians being

randomly selected from the departments

of infectious diseases in a city had

received a serological test. As a result, 35

out of 150 were positive(23%). It was

known that the positive rate in the

general population of the city was 17%.

Page 30: Chapter 4(2) Hypothesisi Testing

Please judge whether the positive rate

among the physicians working for the

departments of infectious diseases was

higher than that in the general

population.

Page 31: Chapter 4(2) Hypothesisi Testing

Solution:

17.0:0 H

17.0:1 H

Page 32: Chapter 4(2) Hypothesisi Testing

)150

)17.01(17.0,17.0(~

NP

06.2

150/17.0117.0

17.0150/35

Z

02.0P

Page 33: Chapter 4(2) Hypothesisi Testing

4.6.1.2 Two samples

Example 4.8 To evaluate the effect of

the routine therapy incorporating with

psychological therapy, the patients with

the same disease in a hospital were

randomly divided into two groups

receiving routine therapy and routine

plus psychological therapy respectively.

Page 34: Chapter 4(2) Hypothesisi Testing

After a period of treatment, evaluating

with the same criterion, 48 out of 80

patients (60%) in the group with routine

therapy were effective, while 55 out of 75

(73%) in other group were effective.

Please judge whether the probability of

effective were different in terms of

population.

Page 35: Chapter 4(2) Hypothesisi Testing

Solution:

210 : H

211 : H

Page 36: Chapter 4(2) Hypothesisi Testing

))1(

,(~1

1111 n

NP )

)1(,(~

2

2222 n

NP

))1()1(

,0(~2

22

1

1121 nnNPP

155

103

7580

5548

21

22110

nn

PnPnP

Page 37: Chapter 4(2) Hypothesisi Testing

))75

1

80

1)(

155

1031(

155

103,0(~21 NPP

75

1

80

1

155

1031

155

10321 PP

Z

Page 38: Chapter 4(2) Hypothesisi Testing

76.1

751

801

155103

1155103

7555

8048

Z

P=0.08

Page 39: Chapter 4(2) Hypothesisi Testing

4.6.2

The Z-test for the population mean of

Poisson distribution (largeλ)

Page 40: Chapter 4(2) Hypothesisi Testing

4.6.2 The Z-test for the population mean of Poisson distribution (largeλ)

),(~ NX

Page 41: Chapter 4(2) Hypothesisi Testing

4.6.2.1 Single observation

Example 4.9 The quality control

criterion of an instrument specifies that

the population mean of radioactivity

recorded in a fixed period should not be

higher than 50. Now a monitoring test

results in a record of 58. Please judge

whether this instrument is qualified in

terms of the population mean.

Page 42: Chapter 4(2) Hypothesisi Testing

Solution:

50:0 H

50:1 H

)50,50(~ NX

Page 43: Chapter 4(2) Hypothesisi Testing

13.150

5058

Z

P = 0.13

Page 44: Chapter 4(2) Hypothesisi Testing

4.6.2.2 Two observations

Example 4.10 The radioactivity of two

specimens was measured for 1 minute

independently, resulting in X1=150 and

X2=120 respectively. Please judge

whether the two corresponding

population means in 1 minute are equal

or not.

Page 45: Chapter 4(2) Hypothesisi Testing

210 : H

Solution:

211 : H

Page 46: Chapter 4(2) Hypothesisi Testing

),(~1 NX ),(~2 NX

)2,0(~21 NXX

)1,0(~21

21 NXX

XXZ

Page 47: Chapter 4(2) Hypothesisi Testing

83.1120150

120150

Z

Page 48: Chapter 4(2) Hypothesisi Testing

4.6.2.3 Two “groups” of observations

Example 4.11 The radioactivity of two

specimens was independently measured

for 10 minutes and 15 minutes

respectively, resulting in X1=1500 and

X2=1800.

Please judge whether the two

corresponding population means in 1

minute are equal or not.

Page 49: Chapter 4(2) Hypothesisi Testing

Solution:

),(~ 111 NX ),(~ 222 NX

),(~1

111 n

NX ),(~

2

222 n

NX

),(~2

2

1

12121 nn

NXX

Page 50: Chapter 4(2) Hypothesisi Testing

2

2

1

1

21

nX

nX

XXZ

26.6

1512010150

120150

Z

Page 51: Chapter 4(2) Hypothesisi Testing

THE END

THANKS!