41
Ch7 Inference concerning means II Dr. Deshi Ye [email protected]

Ch7 Inference concerning means II Dr. Deshi Ye [email protected]

Embed Size (px)

Citation preview

Page 1: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

Ch7 Inference concerning means II

Dr. Deshi Ye

[email protected]

Page 2: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

2

Review Point estimation: calculate the estimated standard error to accompany the point estimate of a population.

Interval estimation whatever the population, when the sample size is large, calculate the

100(1-a)% confidence interval for the mean

When the population is normal, calculate the 100(1-a)% confidence interval for the mean

Where is the obtained from t-distribution with n-1 degrees of

freedom.

ns /x

/ 2 / 2x z x zn n

/ 2 / 2

s sx t x t

n n

/ 2t

Page 3: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

3

Review con.Test of Hypothesis

5 steps totally. Formulate the assertion that the experiment seeks to confirm as the alternative hypothesis

P-value calculation

the smallest fixed level at which the null hypothesis can be rejected.

Page 4: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

4

Outline

Inference concerning two means

Design Issues – Randomization and Pairing

Page 5: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

5

7.8 Inference concerning two means

In many statistical problems, we are faced with decision about the relative size of the means of two or more populations.

Tests concerning the difference between two means

Consider two populations having the mean

and and the variances of and

and we want to test null hypothesis1 2 1 2

1 2 Random samples of size 1 2n and n

Page 6: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

6

Two Population Tests

TwoPopulations

Z Test(Large

sample)

t Test(Pairedsample)

Z Test

Proportion Variance

F Testt Test(Small

sample)

Paired

Indep.

Mean

Page 7: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

Testing Two Means

Independent Sampling& Paired Difference Experiments

Page 8: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

8

Two Population Tests

TwoPopulations

Z Test(Large

sample)

t Test(Pairedsample)

Z Test

Proportion Variance

F Testt Test(Small

sample)

Paired

Indep.

Mean

TwoPopulations

Z Test(Large

sample)

t Test(Pairedsample)

Z Test

Proportion Variance

F Testt Test(Small

sample)

Paired

Indep.

Mean

Page 9: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

9

Independent & Related Populations

IndependentIndependent RelatedRelated

Page 10: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

10

Independent & Related Populations

1. Different Data Sources

Unrelated

Independent

IndependentIndependent RelatedRelated

Page 11: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

11

1. Different Data Sources

Unrelated

Independent

1. Same Data Source

Paired or Matched

Repeated Measures(Before/After)

IndependentIndependent RelatedRelated

Independent & Related Populations

Page 12: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

12

1. Different Data Sources

Unrelated

Independent

2. Use Difference Between the 2 Sample Means

X1 -X2

1. Same Data Source

Paired or Matched

Repeated Measures(Before/After)

IndependentIndependent RelatedRelated

Independent & Related Populations

Page 13: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

13

1. Different Data Sources

Unrelated

Independent

2. Use Difference Between the 2 Sample Means

X1 -X2

1. Same Data Source

Paired or Matched

Repeated Measures(Before/After)

2. Use Difference Between Each Pair of Observations

Di = X1i - X2i

IndependentIndependent RelatedRelated

Independent & Related Populations

Page 14: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

14

Two Independent Populations Examples

1. An economist wishes to determine whether there is a difference in mean family income for households in 2 socioeconomic groups.

2. An admissions officer of a small liberal arts college wants to compare the mean SAT scores of applicants educated in rural high schools & in urban high schools.

Page 15: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

15

Two Related Populations Examples

1. Nike wants to see if there is a difference in durability of 2 sole materials. One type is placed on one shoe, the other type on the other shoe of the same pair.

2. An analyst for Educational Testing Service wants to compare the mean GMAT scores of students before & after taking a GMAT review course.

Page 16: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

16

Thinking Challenge

1. Miles per gallon ratings of cars before & after mounting radial tires

2. The life expectancy of light bulbs made in 2 different factories

3. Difference in hardness between 2 metals: one contains an alloy, one doesn’t

4. Tread life of two different motorcycle tires: one on the front, the other on the back

Are They Independent or Paired?Are They Independent or Paired?

Page 17: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

Testing 2 Independent Means

Page 18: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

18

Two Population Tests

TwoPopulations

Z Test(Large

sample)

t Test(Pairedsample)

Z Test

Proportion Variance

F Testt Test(Small

sample)

Paired

Indep.

Mean

TwoPopulations

Z Test(Large

sample)

t Test(Pairedsample)

Z Test

Proportion Variance

F Testt Test(Small

sample)

Paired

Indep.

Mean

Page 19: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

19

Test The test will depend on the difference between the sample means and if both samples come from normal population with known variances, it can be based on the statistic

1 2X X

1 2

1 2

( )X X

X XZ

Page 20: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

20

TheoremIf the distribution of two independent random variables have the mean and

and the variance and , then the distribution of their sum (or difference) has the mean (or ) and the variance

1 21 2

1 2 1 2 2 21 2

1

22 1

1X n

2

22 2

2X n

Two different sample of size

Page 21: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

21

Statistic for test concerning different between two means

1 2

2 21 2

1 2

( )X XZ

n n

Is a random variable having the standard normal distribution.

Or large samples

1 2

2 21 2

1 2

( )X XZ

S Sn n

Page 22: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

22

Criterion Region for testing 1 2

Alternative hypothesis

Reject null hypothesis if

1 2 Z z

Z z

/ 2 / 2Z z or Z z

1 2

1 2

Page 23: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

23

EX.To test the claim that the resistance of electric wire can be reduced by more than 0.05 ohm by alloying, 32 values obtained for standard wire yielded ohm and ohm , and 32 values obtained for alloyed wire yielded

ohm and ohm

Question: At the 0.05 level of significance, does this support the claim?

1 0.136x 1 0.004s

2 0.083x 2 0.005s

Page 24: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

24

Solution1. Null hypothesis: 1 2 0.05

Alternative hypothesis 1 2 0.05

2. Level of significance: 0.05

3. Criterion: Reject the null hypothesis if Z > 1.645

4. Calculation: 2 2

0.136 0.083 0.052.65

(0.004) (0.005)

32 32

z

5. The null hypothesis must be rejected.

6. P-value: 1-0.996=0.04 < level of significance

Page 25: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

25

Critical values

One-sided alternatives

Two-sided alternatives

-1.645

1.645

-1.96

1.96

-2.33

2.33

-2.575

2.575

0.05

0.01

Page 26: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

26

Type II errorsTo judge the strength of support for the null hypothesis when it is not rejected.

Check it from Table 8 at the end of the textbook

2 21 22 21 2

1 2

n

n n

The size of two examples are not equal

Page 27: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

27

Small sample size2-sample t test.

2 221 2 1 1 2 2

1 2

1 2

( ) ( 1) ( 1),

21 1p

p

X X n S n St where S

n nS

n n

Page 28: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

28

Criterion Region for testing (Statistic for small sample )

Alternative hypothesis

Reject null hypothesis if

1 2

T t

T t

/ 2 / 2T t or T t

1 2

1 2

1 2

Page 29: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

29

EX

Mine 1 Mine 28260 79508130 78908350 79008070 81408340 7920

7840

The following random samples are measurements of the heat-producing capacity of specimens of coal from two mines

Question: use the 0.01 level of significance to test where the difference between the means of these two samples is significant.

Page 30: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

30

Solution1. Null hypothesis: 1 2 0

Alternative hypothesis 1 2 0

2. Level of significance: 0.01

3. Criterion: Reject the null hypothesis if t > 3.25 or t< -3.25

4. Calculation:

5. The null hypothesis must be rejected. 6. P-value: 0.004 < level of significance 0.01

21 2 1

2 22

63408230, 7940, 15750

454600 63000 54600

10920, 13066.75 5 4

8230 7940114.31, 4.19

1 1114.31

5 6

p

p

x x s

s s

s t

Page 31: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

31

Calculate it in Minitab

Page 32: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

32

OutputTwo-sample T for Mine 1 vs Mine 2

SE N Mean StDev MeanMine 1 5 8230 125 56Mine 2 6 7940 104 43

Difference = mu (Mine 1) - mu (Mine 2)Estimate for difference: 290.00099% CI for difference: (133.418, 446.582)T-Test of difference = 0 (vs not =): T-Value = 4.19 P-Value = 0.02 DF = 9

Page 33: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

33

SE mean: (standard error of mean) is calculated by dividing the standard deviation by the square root of n.

StDev: standard deviation .1s

Page 34: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

34

Confidence interval100(1-a)% confidence interval for

2 21 1 2 2

1 2 / 21 2 1 2

( 1) ( 1) 1 1

2

n s n sx x t

n n n n

Where is based on degrees of freedom./ 2t 1 2 2n n

Page 35: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

35

CI for large sample

2 21 2

1 2 / 21 2

s sx x z

n n

Page 36: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

36

Matched pairs comparisonsQuestion: Are the samples independent in the application of the two sample t test?For instance, the test cannot be used when we deal with “before and after” data, where the data are naturally paired. EX: A manufacturer is concerned about the loss of weight of ceramic parts during a baking step. Let the pair of random variables denote the weight before and weight after baking for the i-th specimen.

( , )i iX Y

Page 37: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

37

Statistical analysisConsidering the difference

This collection of differences is treated as random sample of size n from a population having mean

i i iD X Y

D: indicates the means of the two responses are the same0D

Null hypothesis:0 ,0: D DH

2

,0 21 1

( ), ,

1/

n n

i iD i i

D

D

D D DD

where D Sn nS n

Page 38: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

38

EXThe following are the average weekly losses of worker-hours due to accidents in 10-industrial plants before and after a certain safety program was put into operation:

Before 45 73 46 124 33 57 83 34 26 17

After 36 60 44 119 35 51 77 29 24 11

Question: Use the 0.05 level of significance to test whether the safety program is effective.

Page 39: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

39

Solution1. Null hypothesis: 0D

Alternative hypothesis 0D

2. Level of significance: 0.05

3. Criterion: Reject the null hypothesis if t > 1.833

4. Calculation: 5.2 04.03

4.08 / 10t

5. The null hypothesis must be rejected at level 0.05.

6. P-value: 1-0.9985=0.0015 < level of significance

Page 40: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

40

Confidence intervalA 90% confidence interval for the mean of a paired difference.

Solution: since n=10 difference have the mean 5.2 and standard variance 4.08,

/ 2 / 2

s sx t x t

n n

4.08 4.085.2 1.83 5.2 1.83

10 10

4.0 6.4

D

Dor

Page 41: Ch7 Inference concerning means II Dr. Deshi Ye yedeshi@zju.edu.cn

41

7.9 Design issues: Randomization and Pairing

Randomization: of treatments prevents uncontrolled sources of variation from exerting a systematic influence on the response

Pairing: according to some variable(s) thought to influence the response will remove the effect of that variable from analysis

Randomizing the assignment of treatments within a pair helps prevent any other uncontrolled variables from influencing the responses in a systematic manner.