NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples...

33
NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary Problems

Transcript of NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples...

Page 1: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL1

Chapter 9. Comparing Two Population Means

9.1 Introduction9.2 Analysis of Paired Samples9.3 Analysis of Independent Samples9.4 Summary9.5 Supplementary Problems

Page 2: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL2

9.1 Introduction

9.1.1 Two Sample Problems(1/7)

• A set of data observations x1,… , xn from a population A

with a cumulative dist. FA(x),

a set of data observations y1,… , ym from another population B

with a cumulative dist. FB(x).

• How to compare the means of the two populations, and ? (Fig.9.1)

• What if the variances are not the same between the two populations ? (Fig.9.2)

A B

Page 3: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL3

9.1.1 Two Sample Problems (2/7)

Probability distribution

of population BProbability distribution

of population A

Fig.9.1 Comparison of the means of two prob. dists.

A B

?A BIs

Probability distribution

of population A

Probability distribution

of population B

Fig.9.2 Comparison of the variance of two prob. dists.

2 2 ?A BIs

A B

Page 4: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL4

9.1.1 Two Sample Problems (3/7)

• Example 49. Acrophobia Treatments - In an experiment to investigate whether the new treatment is effective or not, a group of 30 patients suffering from acrophobia are randomly assigned to one of the two treatment methods.

- 15 patients undergo the standard treat- ment, say A, and 15 patients undergo the proposed new treatment B.

Fig.9.3 Treating acrophobia.

Page 5: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL5

9.1.1 Two Sample Problems (4/7)

- observations x1,… , x15 ~ A (standard treatment),

observations y1,… , y15 ~ B (new treatment).

- For this example, a comparison of the population means and ,

provides an indication of whether the new treatment is any better or

any worse than the standard treatment.

A B

Page 6: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL6

9.1.1 Two Sample Problems (5/7)

- It is good experimental practice to randomize the allocation of subjects or experimental objects between standard treatment and the new treatment, as shown in Figure 9.4.

- Randomization helps to eliminate any bias that may otherwise arise if certain kinds of subject are “favored” and given a particular treatment.

• Some more words: placebo, blind experiment, double-blind experiment

Fig.9.4 Randomization of experimental subjects between two treatment

Page 7: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL7

9.1.1 Two Sample Problems (6/7)

• Example 44. Fabric Absorption Properties - If the rollers rotate at 24 revolutions per minute, how does changing the

pressure from 10 pounds per square inch (type A) to 20 pounds per square inch (type B) influence the water pickup of the fabric?

- data observations xi of the fabric water pickup with type A pressure

and observations yi with type B pressure.

- A comparison of the population means and shows how the average fabric water pickup is influenced by the change in

pressure.

A B

Page 8: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL8

9.1.1 Two Sample Problems (7/7)

• Consider testing

• What if a confidence interval of contains zero ?

• Small p-values indicate that the null hypothesis is not a plausible statement,

and there is sufficient evidence that the two population means are different.

• How to find the p-value ?Just in the same way as for one-sample problems

A B

0 : A BH

Page 9: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL9

•9.1.2 Paired Samples Versus Independent Samples (1/2)

• Example 53. Heart Rate Reduction

- A new drug for inducing a temporary reduction in a patient’s heart rate is to be compared with a standard drug.

- Since the drug efficacy is expected to depend heavily on the particular patient involved, a paired experiment is run whereby each of 40 patients is administered one drug on one day and the other drug on the following day.

- blocking: it is important to block out unwanted sources of variation that otherwise might cloud the comparisons of real interest

Page 10: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL10

9.1.2 Paired Samples Versus Independent Samples (2/2)

• Data from paired samples are of the form (x1, y1), (x2, y2), …, (xn, yn) which

arise from each of n experimental subjects being subjected to both “treatments”

• The comparison between the two treatments is then based upon the pairwise

differences zi = xi – yi , 1 ≤ i ≤ n

Fig.9.9 Paired and independent samples

Page 11: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL11

9.2 Analysis of Paired Samples

9.2.1 Methodology

• Data observations (x1, y1), (x2, y2), …, (xn, yn)

One sample technique can be applied to the data set zi = xi – yi , 1 ≤ i ≤ n,

in order to make inferences about the unknown mean (average difference).

where the observation obtained when treatment A is applied to the th experimental

subject, can be thought of as a treatment A effect , together with a subject effect

sa

,

,

A

i

Ai i iA

Bi i iB

i

i

x

y

y, and with some random error .Ai

Page 12: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL12

i

A B

Since this error term is an observation from a dist. with a zero expectation,

z 's may be regarded as observations from a distribution with

mean μ=μ -μ , which does not depen

,ABi iBA

AB A Bi i i

z

id on the subject effect γ .

Page 13: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL13

9.2.2 Examples(1/2)

• Example 53. Heat Rate Reduction

- An initial investigation of the data observations zi

reveals that 30 of 40 are negative. This suggests that

-

-

0A B

The sample average 2.655, the sample standard

deviation 3.730, so that with 0, the -statistic is

( ) 40 ( 2.655)4.50

3.730

z

s t

n zt

s

0

39

: 0 versus : 0Two sided hypothesis is ,

-value 2 ( 4.50) 0.0001, where ~ ( ).AH H

p P X X t

Page 14: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL14

9.2.2 Examples(2/2)

-

-

- Consequently, the new drug provides a reduction in a patient’s heart rate of

somewhere between 1% and 4.25% more on average than the standard drug.

This reveals that it is not plausible that 0, we can conclude that

there is evidence that the new drug has a different effect from the standard drug.

0.005, 39

0.005, 39 0.005, 39

2.7079, a 99% two-sided confidence interval for the difference

between the average effects of the drugs is

,

2.7079 3.730 2.7079 3.7302.655 , 2.655

40 40

A B

t

t s t sz z

n n

4.252, 1.058

Page 15: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL15

9.3 Analysis of Independent Samples

Samples size mean standard deviation

Population A n

Population B m

1 2, , ... , nx x x

1 2, , ... , my y yx

yxs

ys

2

2

2 2

The point estimate of is .

Var( ) / ,

Var( ) /

Standard error is . .( )

A B

A

B

A B

x y

x n

y m

s e x yn m

Page 16: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL16

2Assume that the population variance is unknown.

The standard errors for two-sample - tests are as follows:

) in the general procesure:

. .(

t

i

s e x

22

2 2

) ,

) in the pooled variance procesure:

1 1. .( )

When and are assumed to take "known" values, we use a two-sample -test.

yx

p

A B

ssy

n mii

s e x y sn m

z

Page 17: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL17

9.3.1 General Procedure (Smith-Satterthwaite test)•

22

. .( )

Inference about uses a point estimate whose standard error is

estimated by

In this case, - values and critical points are calculated from a t-distribution.

yx

A B

ss

x

s e x yn m

y

p

22 2

4 2 4 2Degrees of freedom ,

or at least the value rounded down to the nearest integer.

The simpler choice min{ , } 1 can be used, although it is a little less powe

/ /

/ ( 1) / ( 1)x y

x y

n m

s n s m

s n n s m m

rful.

Page 18: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL18

2 22 2

/ 2, / 2,

A two-sided 1 level confidence interval for is

,

A standard format is

. . .( ),

A B

y yx xA B

s ss sx y t x y t

n m n m

critical pt s e

. . .( )critical pt s e

Page 19: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL19

22

,

22

,

One sided confidence intervals are

,

,

yxA B

yxA B

ssx y t and

n m

ssx y t

n m

0

2 2

For the two-sided hypothesis testing problem

: : for fixed value of interest(usually 0).

The appropriate t-statistic is / /

A B A A B

x y

H versus H

x yt

s n s m

Page 20: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL20

A two-sided - value is calculated as 2 ( | |), where the random variable

has a - distribution with degrees of freedom, and one-sided - values are

( ) and ( ).

A size two-sided hypothesis t

p P X t

X t p

P X t P X t

0 / 2,

0 / 2 , ,,

accepts H if | | and

rejects H when |

est

or , for one-sided hypo. test|

t t

t t tt t t

Page 21: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL21

0

2 2

Suppose 24, 9.005, 3.438 and 34, 11.864, 3.305.

The hypotheses : : are tested with

9.005 11.864

3.438 / 24 3.305 /3 69

34.1

x y

A B A A B

n x s m y s

H versus H

t

2 2 2

4 2 4 2

The two-sided - value is therfore - value 2 ( 3.169), where

(3.438 / 24 3.305 / 24)48.43

3.438 /(24 23) 3.305 /(34 33)

Using the integer value 48 gives

- value 2 0. 0.00200135 7.

p p P X

p

A

So there is very strong ecidence that the

null hypothesis is not a plausible state-

ment, and the experimenter can conclude

that .B

p-value=0.0027

Fig.9.22

Page 22: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL22

2 2

B 0.005,48

2 2

0.005,48

A 99% two-sided confidence interval for the difference in population means

3.438 3.305(9.005 11.864 ,

24 34

3.438 3.3059.005 11.864 ) ( 5.28, 0.44)

24 34

A t

t

0

The fact that zero is not contained within this confidence interval implies

that the null hypothesis : has a two-sided - value smaller than

0.01, which is consistent with the previous analysis.A BH p

Page 23: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL23

9.3.2 Pooled Variance Procedure

2 22 2 22

A B

2 2

pooled variance

( 1) ( 1)ˆAssume , then the estimte

2which is known as the .

In this case, the standard error of - is

. .( -

estimato

) ,

which can be

r

1

es

1

x yp

A B

n s m ss

n m

x y

s e x yn m n m

2timated by1 1

psn m

Page 24: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL24

When a pooled variance estimate is employed,

-values and critical points are calculated from a

-distribution with - 2 degrees of freedom.

So, a two-sided 1 level confidence interval

p

t n m

B

B / 2, 2 / 2, 2

for is

1 1 1 1,

which again is constructed using the standard format

. .( ), . .( ) with

A

A n m p n m px y t s x y t sn m n m

critical point s e critical point s e

B.A

Page 25: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL25

0

2 2

Consider again the data obtained with 24, 9.005, 3.438 and 34,

11.864, 3.305. The hypotheses : : are tested

23 3.438 33 3.305with 3.192, where 3.

24 34 21/ 1/

x

y A B A A B

p

p

n x s m

y s H versus H

x yt s

s n m

360

p-value=0.0023

The two-sided -value is 2 ( 3.192) 2 0.00115 00023,

where . . has a -distribution with . . 2 56.

p P X

r v X t d f n m

Fig.9.24

Page 26: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL26

9.3.3. z-Procedure•

-

-

B

Two-sample -tests are used when an experimenter wishes to use "known" values

of the population standard deviations and in place of and .A x y

z

s s

In this case, -values and critical points are calculated from the standard normal

distribution.

p

2

2

Consider a sample of size from population A with , and a sample size m

from population B with , .

A

B

n x

y

2 2 2 2

B / 2 / 2

A two-sided 1 level confidence interval for the difference in population

means is ,A B A BA x y z x y z

n m n m

2 2 2 2

/ 2 / 2

One-sided confidence intervals are

, and ,A B A Bx y z x y zn m n m

Page 27: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL27

0

2 2

The appropiate -statistic for the null hypothesis : is

/ /

A B

A B

z H

x yz

n m

A two-sided -value is calculated as 2 ( | |), and one-sided -values are

1 ( ) and ( ).

p z p

z z

/ 2

/ 2

/ 2 / 2

A size two-sided hypothesis test accepts the ull hypothesis if | |

and reject the null hypothesis when | |

and size one-sided hypothesis tests have rejection regions or .

z z

z z

z z z z

Page 28: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL28

9.3.4. Examples(1/2)

• Example 49. Acrophobia Treatments

- unpooled analysis (from Minitab)

0 0The one-sided hypothesis testing : :

15, 47.47, 51.20, and 11.40, 10.09A B A B

x y

H versus H

n m x y s s

2 2 2

4 2 4 2

2 2

(11.40 /15 10.09 /15)27.59(DF),

11.40 /(15 14) 10.09 /(15 14)

47.47 51.200.949, ( 0.949) 0.175

11.40 /15 10.09 /15t P X

Fig.9.25 Acrophobia treatment data set (improvement scores)

Page 29: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL29

9.3.4. Examples(2/2)

- Analysis using pooled variance

* Almost same as in the unpooled case.

2 22

47.47 51.200.946,

10.8 1/15 1/152 28,

14 11.40 14 10.09115.88 115.88 10.8

28p p

t

n m

s or s

Page 30: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL30

9.3.5. Sample Size Calculations

• Interest : determination of appropriate sample sizes n and m, or

an assessment of the precision afforded by given sample sizes

22

/ 2,For the general procedure, confidence interval length is 2

If we know that the s.d.'s of the two populations A and B are not larger than

and , respectively, we can then estimate

yx

A B

ssL t

n m

2 2

0 / 2,

/ 2,

that the sample size

n and m are adequate as long as

2

where a suitable value of the critical point can be used.

A BL tn m

t

Page 31: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL31

• Example 44. Fabric Absorption Properties

Based upon samples with 15, a 99% confidence interval for the mean

difference was calculated (6.24,16.26).

This interval has a length of over 10%. A B

n m

0

How much additional sampling is required if the experimenter wants

a 99% confidence interval with a length no larger than 4%?L

2 22/ 2,

20

If an experimenter wishes to have equal sample sizes ,

4 ( )then A B

n m

tn m

L

Page 32: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL32

– to meet the specified goal, the experimenter can estimate that total sample sizes of n=m=95 will suffice.

0.005,28

2 2 2

The initial samples have 4.943 and 4.991, and the (pooled) analysis of

the initial samples uses a critical point 2.763.

4 2.763 (4.943 4.991 )Using these values in the formula

4.

x ys s

t

n m

294.2.

0

Page 33: NIPRL 1 Chapter 9. Comparing Two Population Means 9.1 Introduction 9.2 Analysis of Paired Samples 9.3 Analysis of Independent Samples 9.4 Summary 9.5 Supplementary.

NIPRL33

Summary problems(1) In a one-sample testing problem of means, the rejection

region is in the same direction as the alternative hypothesis.

(yes)

(2) The p-value of a test can be computed without regard to the significance level.

(yes)

(3) The length of a t-interval is larger than that of a z-interval with the same confidence level.

(no)

(4) If we know the p-value of a two-sided testing problem of the mean, we can always see whether the mean is contained in a two-sided confidence interval.

(yes)(5) Independent sample problems may be handled as paired

sample problems.(no)

0( )