Outline Introduction (9.1) Analysis of Paired Samples (9.2) - - PDF document

outline
SMART_READER_LITE
LIVE PREVIEW

Outline Introduction (9.1) Analysis of Paired Samples (9.2) - - PDF document

1/26/2007 219323 Probability and Statistics for Software Statistics for Software and Knowledge Engineers Lecture 10: Comparing Two Population Comparing Two Population Means Monchai Sopitkamon, Ph.D. Outline Introduction (9.1)


slide-1
SLIDE 1

1/26/2007 1

219323 Probability and Statistics for Software Statistics for Software and Knowledge Engineers

Lecture 10: Comparing Two Population Comparing Two Population Means

Monchai Sopitkamon, Ph.D.

Outline

Introduction (9.1) Analysis of Paired Samples (9.2) Analysis of Independent Samples (9.3) Summary (9.4)

slide-2
SLIDE 2

1/26/2007 2

Comparing Two Population Means: Introduction I (9.1)

Two-Sample Problems – making

comparisons between two prob distributions comparisons between two prob distributions

Comparing two distributions by comparing

their means and probably variances

If the means are equal, may be enough to

conclude that the populations are “identical”

Comparing Two Population Means: Introduction II (9.1)

Comparison of the means

  • f two

probability distributions Comparison of the variances of two probability distributions

slide-3
SLIDE 3

1/26/2007 3

Comparing Two Population Means: Introduction III (9.1)

Kudzu pulping experiment μA = μB ?

Comparing Two Population Means: Introduction IV (9.1)

Interpretation of confidence intervals for µ A − µ B

slide-4
SLIDE 4

1/26/2007 4

Comparing Two Population Means: Introduction V (9.1)

A more direct approach to assessing the

plausibility that the population means μA and plausibility that the population means μA and μB are equal is to calculate a p-value for the hypotheses H0: μA = μB versus HA: μA ≠ μB if p-value < 0.01 accept HA if p-value > 0.1 accept H0

Paired Samples Versus Independent Samples I (9.1.2)

Experimental design methodology

provides different ways of collecting and p y g analyzing data for comparison of two populations.

Ex.55 pg.386: Heart Rate Reductions

A new drug for inducing temporary patient’s heart rate reduction is to be compared with a standard drug. 40 patients are given at random a new drug on 40 patients are given, at random, a new drug on day 1 and a standard drug on day 2, and vice versa. Comparison based on the differences for each patient in the percentage heart rate reductions achieved by the two drugs.

slide-5
SLIDE 5

1/26/2007 5

Paired Samples Versus Independent Samples II (9.1.2)

Heart rate reduction experiment

Paired Samples Versus Independent Samples III (9.1.2)

“Blocking”

Equal sample size The distinction between paired and independent samples

slide-6
SLIDE 6

1/26/2007 6

Paired Samples Versus Independent Samples IV (9.1.2)

Variability in patients creates more “noisy” d hi h data, which may not yield accurate interpretation of results! Therefore, paired experiment is more efficient! Unpaired design for heart rate reduction experiment efficient!

Outline

Introduction (9.1) Analysis of Paired Samples (9.2) Analysis of Independent Samples (9.3) Summary (9.4)

slide-7
SLIDE 7

1/26/2007 7

Analysis of Paired Samples I (9.2)

Paired samples w/ data observations

(x y ) (x y ) (x y ) (x1, y1), (x2, y2), …, (xn, yn) is performed by reducing problem to one- sample problem, by calculating zi = xi – yi 1 ≤ i ≤ n zi independent, identically distributed

  • bservations from some prob dist w/ mean
  • bservations from some prob dist w/ mean

μ. μ average difference between “treatments” A and B

Analysis of Paired Samples II (9.2)

If μ > 0 RVs Xi tends to be > RVs Yi, or μA

> μB μB

If μ < 0 RVs Xi tends to be < RVs Yi, or μA

< μB

Perform two-sided hypotheses test

H0: μ = 0 versus HA: μ ≠ 0 and compute p-value and evaluate it p p accordingly.

slide-8
SLIDE 8

1/26/2007 8

Analysis of Paired Samples III (9.2)

Ex.55 pg.390: Heart Rate Reductions

t = -4.50 Two-sided hypothesis test H0: μ = 0 versus HA: μ ≠ 0 w/ the computed p-value = 0.00006 ≅ 0.001 reject null hypothesis H0 which means new drug has a g different effect from the standard drug

Heart rate reductions data set (% reduction in heart rate)

Excel sheet

Two-Sided Hypothesis Test for a Population Mean

( )

s x n t μ − =

Size α two- sided t-test

slide-9
SLIDE 9

1/26/2007 9

Outline

Introduction (9.1) Analysis of Paired Samples (9.2) Analysis of Independent Samples (9.3) Summary (9.4)

Analysis of Independent Samples I (9.3)

Two independent (unpaired) samples Three procedures can be applied

depending on depending on

1. the sample size (if large proc 1), 2. if sample size is small and if the population variances are equal (proc 2), 3. if the population variances are known (proc 3)

Two-sample t-tests Two-sample z-test

slide-10
SLIDE 10

1/26/2007 10

Analysis of Independent Samples: General Procedure I (9.3.1)

Two-Sample t-Procedure (Unequal Variances) A two-sided 1 - α level CI for the difference in population means μA - μB is where the degrees of freedom of critical point is

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − + − − ∈ − m s n s t y x m s n s t y x

y x y x B A 2 2 , 2 / 2 2 , 2 /

,

ν α ν α

μ μ

2 2 2

⎟ ⎟ ⎞ ⎜ ⎜ ⎛ + s s

y x

One-sided CIs are and

) 1 ( ) 1 (

2 4 2 4

− + − ⎟ ⎠ ⎜ ⎝ + = m m s n n s m n

y x

ν

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − ∞ − ∈ − m s n s t y x

y x B A 2 2 ,

,

ν α

μ μ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∞ + − − ∈ − ,

2 2 ,

m s n s t y x

y x B A ν α

μ μ

Analysis of Independent Samples: General Procedure II (9.3.1)

The appropriate t-statistic for the null

hypothesis H0: μA - μB = δ is yp

0 μA

μB

Two-sided p-value = 2xP(X > |t|), where X

has t-distribution w/ ν degrees of freedom

One sided p value = P(X > t) and P(X < t) m s n s y x t

y x 2 2

+ − − = δ One-sided p-value = P(X > t) and P(X < t) A size α two-sided hypothesis test accepts

H0 if |t| ≤ tα/2,ν and rejects H0 if |t| > tα/2,ν

Size α one-sided hypothesis tests have

rejection regions t > tα,ν or t < -tα,ν

slide-11
SLIDE 11

1/26/2007 11

Analysis of Independent Samples: General Procedure III (9.3.1)

n 24 m 34 9.005 11.864 3.438 3.305

x

x

s

y

y

s

The hypotheses H0: μA = μB versus HA: μA ≠ μB are tested w/ t-statistic

Excel sheet

169 . 3 34 305 . 3 24 438 . 3 864 . 11 005 . 9

2 2 2 2

− = + − − = + − − = m s n s y x t

y x

δ

Analysis of Independent Samples: General Procedure IV (9.3.1)

Two-sided p-value = 2xP(X >|-3.169|) = 2x

2xP(X >3.169) 2xP(X 3.169) where X has t-distribution w/ dof. p-value ≅ 2x0 00135 = 0 0027

48 43 . 48 33 34 305 . 3 23 24 348 . 3 34 305 . 3 24 348 . 3 ) 1 ( ) 1 (

2 4 2 4 2 2 2 2 4 2 4 2 2 2

≅ = × + × ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + = − + − ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + = m m s n n s m s n s

y x y x

ν

p-value ≅ 2x0.00135 = 0.0027 since 0.0027 < 0.01 null hypothesis H0: μA = μB is rejected, and it can be concluded that μA ≠ μB

Excel sheet

slide-12
SLIDE 12

1/26/2007 12

Analysis of Independent Samples: General Procedure V (9.3.1)

Calculation of a two-sided p-value

Analysis of Independent Samples: General Procedure VI (9.3.1)

Construct a two-sided 99% CI for the difference

in population means μA – μB, using critical point tα/2 ν = t0 005 48 = 2.6822

α/2,ν 0.005,48

305 . 3 438 . 3 6822 2 864 11 005 9 , 34 305 . 3 24 438 . 3 6822 . 2 864 . 11 005 . 9 ,

2 2 2 2 2 2 , 2 / 2 2 , 2 /

⎟ ⎟ ⎟ ⎟ ⎟ ⎞ ⎜ ⎜ ⎜ ⎜ ⎜ ⎛ + + + − − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − + − − ∈ − m s n s t y x m s n s t y x

y x y x B A ν α ν α

μ μ

CI does not include 0 implies that H0: μA = μB has a two-sided p-value < 0.01, consistent w/ the result of the hypothesis test shown in the previous slides

( )

44 . , 28 . 5 34 24 6822 . 2 864 . 11 005 . 9 − − = ⎟ ⎠ ⎜ ⎝ + + − Excel sheet

slide-13
SLIDE 13

1/26/2007 13

Analysis of Independent Samples: General Procedure VII (9.3.1)

R l ti hi b t h th i t ti Relationship between hypothesis testing and confidence intervals for two-sample two-sided problems

Analysis of Independent Samples: Pooled Variance Procedure I (9.3.2)

For small sample sizes and when population

variances are equal ( )

2 2 2

σ σ σ = =

B A

variances are equal Pooled variance estimator:

Consider the previous example. Since the

sample SDs are similar, it could be assumed that the population variances are equal. ( )

B A

( ) ( )

2 1 1 ˆ

2 2 2 2

− + − + − = = m n s m s n s

y x p

σ

p p q Therefore, the estimated common SD is ( ) ( )

360 . 3 2 34 24 305 . 3 33 ( ) 438 . 3 23 ( 2 1 1

2 2 2 2

= − + × + × = − + − + − = m n s m s n s

y x p

Excel sheet

slide-14
SLIDE 14

1/26/2007 14

Analysis of Independent Samples: Pooled Variance Procedure II (9.3.2)

The hypotheses

H : μ = μ versus H : μ ≠ μ H0: μA = μB versus HA: μA ≠ μB are tested w/ t-statistic The two-sided p-value = 2xP(X > |-3.192|) =

192 . 3 34 1 24 1 360 . 3 864 . 11 005 . 9 1 1 − = + − = + − = m n s y x t

p

2xP(X > 3.192) ≅ 2x0.00115 = 0.0023 where X has t-distribution w/ dof n+m-2 = 56 as shown in the next figure.

Excel sheet

Analysis of Independent Samples: Pooled Variance Procedure III (9.3.2)

Calculation of a two-sided p-value

slide-15
SLIDE 15

1/26/2007 15

Analysis of Independent Samples: Pooled Variance Procedure IV (9.3.2)

Construct a two-sided 99% CI for the difference in

population means μA – μB, using critical point tα/2,ν = t0 005 48 = 2 6822 t0.005,48 2.6822

1 1 360 . 3 6665 . 2 864 . 11 005 . 9 , 34 1 24 1 360 . 3 6665 . 2 864 . 11 005 . 9 1 1 , 1 1

, 2 / , 2 /

⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ + × × + − + × × − − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − + − − ∈ − m n s t y x m n s t y x

p p B A ν α ν α

μ μ

As in the general procedure, CI does not include 0 implies that H0: μA = μB has a two-sided p-value < 0.01, consistent w/ the result of the hypothesis test shown in the previous slides

( )

47 . , 25 . 5 34 24 360 . 3 6665 . 2 864 . 11 005 . 9 − − = ⎟ ⎠ ⎜ ⎝ + + Excel sheet

Analysis of Independent Samples: Pooled Variance Procedure V (9.3.2)

Two-Sample t-Procedure (Equal Variances) Common

( ) ( )

1 1

2 2 2

− + − s m s n

y x

variance: A two-sided 1 - α level CI for the difference in population means μA - μB is

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − + − − ∈ −

− + − +

m n s t y x m n s t y x

p m n p m n B A

1 1 , 1 1

2 , 2 / 2 , 2 / α α

μ μ

( ) ( )

2

2

− + = m n s m s n s

y x p

One-sided CIs are and

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − ∞ − ∈ −

− +

m n s t y x

p m n B A

1 1 ,

2 , α

μ μ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∞ + − − ∈ −

− +

, 1 1

2 ,

m n s t y x

p m n B A α

μ μ

slide-16
SLIDE 16

1/26/2007 16

Analysis of Independent Samples: Pooled Variance Procedure VI (9.3.2)

The appropriate t-statistic for the null

hypothesis H0: μA - μB = δ is yp

0 μA

μB

Two-sided p-value = 2xP(X > |t|), where X

has t-distribution w/ n+m-2 dof.

One sided p value = P(X > t) and P(X < t) m n s y x t

p

1 1 + − − = δ One-sided p-value = P(X > t) and P(X < t) A size α two-sided hypothesis test accepts

H0 if |t| ≤ tα/2,n+m-2 and rejects H0 if |t| > tα/2, n+m-2

Size α one-sided hypothesis tests have

rejection regions t > tα, n+m-2 or t < -tα, n+m-2

Analysis of Independent Samples: Pooled Variance Procedure VII (9.3.2)

Conclusions

– Safest approach is to always use the general Safest approach is to always use the general procedure since it provides valid analysis even when the population variances are equal. – If the population variances are equal or quite similar, then the pooled variance procedure typically provides a more powerful analysis with shorter CIs and smaller p-values.

slide-17
SLIDE 17

1/26/2007 17

Analysis of Independent Samples: z- Procedure I (9.3.3)

Two-Sample z-Procedure A two-sided 1 - α level CI for the difference in population means μA - μB is One-sided CIs are

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + + − + − − ∈ − m n z y x m n z y x

B A B A B A 2 2 2 / 2 2 2 /

, σ σ σ σ μ μ

α α

⎟ ⎟ ⎞ ⎜ ⎜ ⎛ + + ∞ ∈ z y x

B A 2 2

σ σ μ μ

and

⎟ ⎟ ⎠ ⎜ ⎜ ⎝ + + − ∞ − ∈ − m n z y x

B A

, μ μ

α

⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∞ + − − ∈ − ,

2 2

m n z y x

B A B A

σ σ μ μ

α

Analysis of Independent Samples: z- Procedure II (9.3.3)

The appropriate z-statistic for the null

hypothesis H0: μA - μB = δ is hypothesis H0: μA μB δ is

Two-sided p-value = 2xΦ(-|z|) One-sided p-value = 1 – Φ(z) and Φ(z) m n y x z

B A 2 2

σ σ δ + − − = One-sided p-value = 1

Φ(z) and Φ(z)

A size α two-sided hypothesis test accepts

H0 if |z| ≤ zα/2 and rejects H0 if |z| > zα/2

Size α one-sided hypothesis tests have

rejection regions z > zα or z < -zα

slide-18
SLIDE 18

1/26/2007 18 To estimate minimum sample sizes required to

  • btain a CI of length no larger than L0:

Sample Size Calculations I (9.3.5)

where n, m: sample sizes of population A and B, respectively

( )

2 2 2 2 , 2 /

4 L t m n

B A

σ σ

ν α

+ ≥ = respectively L0: maximum CI length desired tα/2,ν: suitable critical point depending on the confidence level 1 - α required σA, σB: SDs of population A and B, respectively

Sample Size Calculations II (9.3.5)

Ex.45 pg.410: Fabric Water Absorption

Properties Using the existing values in the formula Using the existing values in the formula in place of the critical point and the population variances gives

( )

2 2 2 2 , 2 /

4 L t m n

B A

σ σ

ν α

+ ≥ =

( )

991 4 943 4 763 2 4

2 2 2

+ × Therefore, total sample sizes of n=m=95 are required, or an additional sampling of 80

  • bservations from each level is required.

( )

2 . 94 . 4 991 . 4 943 . 4 763 . 2 4

2 2 2 2

= + × ≥ = m n

Excel sheet

slide-19
SLIDE 19

1/26/2007 19

Outline

Introduction (9.1) Analysis of Paired Samples (9.2) Analysis of Independent Samples (9.3) Summary (9.4)

Summary I (9.4)

Whether it should be a paired problem or an

unpaired problem? unpaired problem?

If an extraneous source of variability can be

identified, use a paired experiment.

Paired two-sample problem simplifies to a

  • ne-sample problem of differences in data
  • bservations within each pairing.

Two independent (unpaired) samples can

be analyzed with two-sample t-tests or two- sample z-tests.

Two-sample t-tests can be used with or

without pooling the variances.

slide-20
SLIDE 20

1/26/2007 20

Summary II (9.4)

For the general procedure,

– the populations variances need not be equal the populations variances need not be equal

For pooled procedure,

– the population variances should be similar or equal

For z-procedure,

– population variances must be known

In all three procedures,

– sample sizes n and m ≥ 30, or – small sample sizes w/ normally distributed data