0% found this document useful (0 votes)
79 views23 pages

Math/Stat 370: Engineering Statistics: Haijun Li

The document discusses comparing means of two populations when the variances are known or unknown. When variances are known, a z-test is used to test hypotheses about the difference in population means. When variances are unknown, a pooled variance estimate is used and a t-test is conducted to test hypotheses about the difference in means. Examples are provided to illustrate hypothesis testing and calculating confidence intervals for the difference in means and determining necessary sample sizes.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views23 pages

Math/Stat 370: Engineering Statistics: Haijun Li

The document discusses comparing means of two populations when the variances are known or unknown. When variances are known, a z-test is used to test hypotheses about the difference in population means. When variances are unknown, a pooled variance estimate is used and a t-test is conducted to test hypotheses about the difference in means. Examples are provided to illustrate hypothesis testing and calculating confidence intervals for the difference in means and determining necessary sample sizes.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Math/Stat 370: Engineering Statistics

Haijun Li
[email protected] Department of Mathematics Washington State University

Week 9

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

1 / 16

ence in the parameters of the two populations.

Comparing Means of Two Populations


Two populations respectively, unknown means 1TWO and 2 , INFERENCE FOR with, A2DIFFERENCE IN MEANS OF 2. known variances and 1 2 NORMAL DISTRIBUTIONS, VARIANCES KNOWN

Hypotheses: H0 : 1 = 2 VS H1 : 1 = 2 . More general: consider H1 : 1inferences 2 = 0 : 1 2 = 0 VS 0 . the difference In this H section we statistical on 2 Test the hypotheses with signicant level . normal distributions, where the variances 1 and 2 2 are known. Th Take a sample X1follows. 11 , X12 , . . . , as n1 from population 1. tion areX summarized Take a sample X21 , X22 , . . . , X2n2 from population 2. Two samples are independent.
Population 1
2 1

Population 2 2
2

e 10-1 Two endent populaHaijun Li

1 Sample 1: x11, x12,, x1n

2 Sample 2: x21, x22,, x2n

Math/Stat 370: Engineering Statistics

Week 9

2 / 16

Test Statistic
The sample average of the rst sample X1 =
n1 i =1 X1i

n1
n2 i =1 X2i

The sample average of the second sample X2 = E ( X 1 X 2 ) = 1 2 . V (X 1 X 2 ) =


2 1 n1

n2

2 2 n2 .

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

3 / 16

Test Statistic
The sample average of the rst sample X1 =
n1 i =1 X1i

n1
n2 i =1 X2i

The sample average of the second sample X2 = E ( X 1 X 2 ) = 1 2 . V (X 1 X 2 ) = Test statistic


2 1 n1

n2

2 2 n2 .

Z0 =

(X 1 X 2 ) 0
2 1 n1

2 2 n2

Z0 has (approximately) standard normal distribution under H0 . z is the 100 percentage point.
Haijun Li Math/Stat 370: Engineering Statistics Week 9 3 / 16

Testing Means of Two Populations, Variance Known


1

9:Desktop Folder:

Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 = 0 (two sided). Rejection region: z0 > z/2 or z0 < z/2 . Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 > 0 (upper). Rejection region: z0 > z . Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 < 0 (lower). Rejection region: z0 < z .

SES FOR A SINGLE SAMPLE

N(0,1) Critical region Acceptance region 0 ( b) z


N(0,1)

al region

Acceptance region z 0 ( c) Z0

Z0

0 is true, with critical region for (a) the two-sided alternative H1 : Figure: Percentage Points (c) the one-sided alternative H1 : 0.
Haijun Li Math/Stat 370: Engineering Statistics

0,
4 / 16

Week 9

Type II Errors
Let = 1 2 denote the true difference. Two-sided alternative, 0 0 = z/2 z/2 . 2 2 2 2 1 2 1 2 + + n1 n2 n1 n2 Upper sided alternative, 0 . = z 2 2 1 2 n1 + n2 Lower sided alternative, 0 = 1 z . 2 2 1 2 n1 + n2
Haijun Li Math/Stat 370: Engineering Statistics Week 9 5 / 16

p Values, and Sample Sizes (n1 = n2 = n)


p-value: The smallest level of signicance that leads to reject H0 . 2(1 (|z0 |)) for two-tailed test (1 (z0 )) for upper tailed test p= (z0 ) for lower tailed test Two-sided alternative, n= One sided alternative, n=
2 + 2) (z + z )2 (1 2 . ( 0 )2 2 + 2) (z/2 + z )2 (1 2 . ( 0 )2

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

6 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have approximately the same SD of burning rates 1 = 2 = 3 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and 1 = 18.02 cm/s and x 2 = 24.37 cm/s. sample mean burning rates are x

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

7 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have approximately the same SD of burning rates 1 = 2 = 3 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and 1 = 18.02 cm/s and x 2 = 24.37 cm/s. sample mean burning rates are x Test the hypothesis that both propellants have the same mean burning rate. Use = 0.05. Solution: Test H0 : 1 = 2 VS H1 : 1 = 2 . Since 0 = 0 and Z0 = X1 X2
2 1 n1

2 2 n2

18.02 24.37 3 1/20 + 1/20

= 6.69 < z0.025 = 1.96,

we reject H0 .

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

7 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have approximately the same SD of burning rates 1 = 2 = 3 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and 1 = 18.02 cm/s and x 2 = 24.37 cm/s. sample mean burning rates are x Test the hypothesis that both propellants have the same mean burning rate. Use = 0.05. Solution: Test H0 : 1 = 2 VS H1 : 1 = 2 . Since 0 = 0 and Z0 = X1 X2
2 1 n1

2 2 n2

18.02 24.37 3 1/20 + 1/20

= 6.69 < z0.025 = 1.96,

we reject H0 . What is the p value of the test? Solution: Since it is a two-sided test, we have that p-value = 2(1 (| 6.69|)) = 0.
Haijun Li Math/Stat 370: Engineering Statistics Week 9 7 / 16

Example (Cont.)

Assuming equal sample sizes, what sample size should be used to ensure that = 0.01 if the true difference in means is 0.04? Solution: Since 0 = 0, = 0.04, z0.025 = 1.96 and z0.01 = 2.33, we have n=
2 + 2) (z/2 + z )2 (1 (1.96 + 2.33)2 18 2 = 208, 012. ( 0 )2 0.042

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

8 / 16

Condence Interval
1

A 100(1 )% CI for 1 2 when the variances are known: 1 x 2 z/2 x


2 1 2 1 x 2 + z/2 + 2 1 2 x n1 n2 2 1 2 + 2, n1 n2

where z/2 is the 100/2 percentage point. A 100(1 )% lower condence bound for 1 2 when the variances are known: 1 x 2 z x
2 1 2 + 2 1 2 . n1 n2

A 100(1 )% upper condence bound for 1 2 when the variances are known: 1 x 2 + z 1 2 x
2 1 2 + 2. n1 n2
Week 9 9 / 16

Haijun Li

Math/Stat 370: Engineering Statistics

Sample Size
The sample size (n1 = n2 ) required for the error 1 x 2 ) (1 2 )| E with 100(1 )% condence is given by |(x n= z/2 E
2 2 2 (1 + 2 ).

Example: Consider the propellant problem discussed above. 1 Find a 99% CI for 1 2 . Solution: Since z0.005 = 2.58, the CI is (18.02 24.37 2.58 18.02 24.37 + 2.58 or (8.8, 3.9). 33 /20 + 32 /20, 33 /20 + 32 /20),

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

10 / 16

Sample Size
The sample size (n1 = n2 ) required for the error 1 x 2 ) (1 2 )| E with 100(1 )% condence is given by |(x n= z/2 E
2 2 2 (1 + 2 ).

Example: Consider the propellant problem discussed above. 1 Find a 99% CI for 1 2 . Solution: Since z0.005 = 2.58, the CI is (18.02 24.37 2.58 18.02 24.37 + 2.58
2

33 /20 + 32 /20, 33 /20 + 32 /20),

or (8.8, 3.9). Find the sample size required for the error to be less than 1.5 cm/s with 95% condence. Solution: Since E = 1.5 and z0.025 = 1.96, we have that n = (1.96/1.5)2 18 = 30.73.
Math/Stat 370: Engineering Statistics Week 9 10 / 16

Haijun Li

Means of Two Populations, Variance Unknown


Two populations with, respectively, unknown means 1 and 2 , INFERENCE FOR A DIFFERENCE IN MEANS OF TWO 2 and 2 . unknown variances 1 2 VARIANCES KNOWN NORMAL DISTRIBUTIONS,

ence in the parameters of the two populations.

Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 = 0 . Take a sample X11 , X12 , . . . , X1n1 from population 1. In this section we consider statistical inferences on the difference Take a sample population 21 , X22 , . . . , X 2n2 from 2 2. normalX distributions, where the variances and 2 are known. Th

tion average are summarized as follows. The sample of the rst sample X 1 =

The sample average of the second sample X 2 =


Population 1 1
2

1 2 n1 i =1 X1i n1 n2 i =1 X2i n2

Population 2 2
2

e 10-1 Two endent populaHaijun Li

1 Sample 1: x11, x12,, x1n

2 Sample 2: x21, x22,, x2n

Math/Stat 370: Engineering Statistics

Week 9

11 / 16

2 2 Pooled Estimator for 1 = 2 = 2

SD:

V (X 1 X 2 ) =

2 = Sample variances: S1 n2 2 = 1 S2 i =1 (X2i X 2 n2 1

1 n2 . n1 1 i =1 (X1i n1 1 2 ) .

1 n1

X 1 )2 and

Pooled estimator (weighted average):


2 Sp = 2 + (n 1)S 2 (n1 1)S1 2 2 2 2 + (1 w )S2 . = wS1 n1 + n2 2

where w =

n1 1 n1 +n2 2

and 1 w = T0 =

n2 1 n1 +n2 2 .

Test statistic (X 1 X 2 ) 0 Sp
1 n1

1 n2

T0 has a t -distribution with n1 + n2 2 degrees of freedom under H0 .


Haijun Li Math/Stat 370: Engineering Statistics Week 9 12 / 16

hypothesis:

X 0 statistic: T2 Let t,n1 +n2 the upper 100 percentage point. 0 denote S 1n 1 Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 = 0 (two sided). ernative hypothesis Rejection criteria Rejection region: t0 > t/2,n1 +n2 2 or t0 < t/2,n1 +n2 2 . H1: Z 0 t0 t/2,n1 or t0 t/2,n1 2 Hypotheses: H : 0 1 2 = 0 VS H1 : 1 2 > 0 (upper). H1: 0 t0 t ,n1 Rejection region: ,n1 +n2 2 . H1: 0 > t,nt t0 t0 1 3 Hypotheses: H0 : 1 2 = 0 VS H1 : 1 2 < 0 (lower). Rejection region: t0 < t,n1 +n2 2 . 8 shows the location of the critical region for these situations.
tn 1 tn 1

2 2 Testing for 1 = 2 = 2

H0: 0

0 ( b)

t , n 1

t , n 1

0 ( c)

T0

n (a) =n n2 1 ution for H0: 0 with critical Figure: region for H : Z 0 , (b) H1: 0, and 1 1+
Haijun Li Math/Stat 370: Engineering Statistics Week 9 13 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have the same SD of burning rates 1 = 2 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and sample mean burning 1 = 18.02 cm/s and x 2 = 24.37 cm/s, sample SDs are rates are x s1 = 3.11 cm/s and s2 = 2.97 cm/s. 1 Test the hypothesis that both propellants have the same mean burning rate. Use = 0.05.

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

14 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have the same SD of burning rates 1 = 2 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and sample mean burning 1 = 18.02 cm/s and x 2 = 24.37 cm/s, sample SDs are rates are x s1 = 3.11 cm/s and s2 = 2.97 cm/s. 1 Test the hypothesis that both propellants have the same mean burning rate. Use = 0.05. Solution: Test H0 : 1 = 2 VS H1 : 1 = 2 . Since 0 = 0 and the 2 2 2 = (201)(3.11) +(201)(2.97) = 9.25, we have pooled estimator sp 20+202 T0 = X1 X2 sp
1 n1

1 n2

18.02 24.37 3.04 1/20 + 1/20

= 6.60,

which is less than t0.025,38 = 2.021. We reject H0 .

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

14 / 16

Example
The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have the same SD of burning rates 1 = 2 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and sample mean burning 1 = 18.02 cm/s and x 2 = 24.37 cm/s, sample SDs are rates are x s1 = 3.11 cm/s and s2 = 2.97 cm/s. 1 Test the hypothesis that both propellants have the same mean burning rate. Use = 0.05. Solution: Test H0 : 1 = 2 VS H1 : 1 = 2 . Since 0 = 0 and the 2 2 2 = (201)(3.11) +(201)(2.97) = 9.25, we have pooled estimator sp 20+202 T0 = X1 X2 sp
2

1 n1

1 n2

18.02 24.37 3.04 1/20 + 1/20

= 6.60,

which is less than t0.025,38 = 2.021. We reject H0 . What is the p value of the test? Solution: The p-value 0.
Math/Stat 370: Engineering Statistics Week 9 14 / 16

Haijun Li

Condence Interval
1

A 100(1 )% CI for 1 2 when the variances are unknown: 1 x 2 t/2,n1 +n2 2 sp x 1 1 + 1 2 n1 n2 1 1 + , n1 n2

1 x 2 + t/2,n1 +n2 2 sp x

where t/2,n1 +n2 2 is the upper 100/2 percentage point.


2

A 100(1 )% lower condence bound for 1 2 when the 1 1 1 x 2 t,n1 +n2 2 sp n variances are unknown: x +n 1 2 .
1 2

A 100(1 )% upper condence bound for 1 2 when the 1 1 1 x 2 + t,n1 +n2 2 sp n variances are known: 1 2 x +n .
1 2 Math/Stat 370: Engineering Statistics Week 9 15 / 16

Haijun Li

Example

The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have the same SD of burning rates 1 = 2 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and sample mean burning 1 = 18.02 cm/s and x 2 = 24.37 cm/s, sample SDs are rates are x s1 = 3.11 cm/s and s2 = 2.97 cm/s. Find a 95% CI for 1 2 .

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

16 / 16

Example

The burning rates of two different solid-fuel propellants used in aircrew escape systems are being studied. It is known that both propellants have the same SD of burning rates 1 = 2 cm/s. Two samples of n1 = 20 and n2 = 20 specimens are tested, and sample mean burning 1 = 18.02 cm/s and x 2 = 24.37 cm/s, sample SDs are rates are x s1 = 3.11 cm/s and s2 = 2.97 cm/s. Find a 95% CI for 1 2 . Solution: Since t0.025,38 = 2.021, the CI is (18.02 24.37 2.021 3.04 1/20 + 1/20, 18.02 24.37 + 2.021 3.04 1/20 + 1/20), or (8.29, 4.41).

Haijun Li

Math/Stat 370: Engineering Statistics

Week 9

16 / 16

You might also like