Transcript lecture8

Test of Hypotheses: Single Sample.

Outlines:  Hypothesis testing  Test on the mean of a normal distribution, variance known    Test on the mean of a normal distribution, variance unknown Test on the variance and standard deviation of a normal distribution Test on a population proportion

Hypothesis testing

   Many problems in engineering require the decision to accept or reject the hypothesis.

A statistical hypothesis : a statement about the parameters of one or more populations.

Ex . Suppose we are interested in burning rate of a solid propellant used to power aircrew escape systems.   Burning rate is a random variable that can be described by a probability distribution.

We are interested in the mean burning rate, specifically in deciding whether or not the mean burning rate is 50 cm/s. 

H0: µ=50 cm/s

H1: µ≠50 cm/s

Hypothesis testing

  Suppose that a sample of n= 10 is tested and the sample mean is observed. is an estimate of the true value of .  

Hypothesis testing

  Suppose if , we cannot reject H

0 If , we will reject H 0 and in favor of H 1

Reject H0 Fail to reject H0 (acceptance region) Reject H0 48.5 50 51.5

Critical value Critical value

Test of Statistical Hypotheses

   Critical region : the interval of the parameter that we will reject the null hypothesis H0 Acceptance region : the interval of the parameter that we will fail to reject the null hypothesis H0 Critical value : the boundary between critical and acceptance regions.

Hypothesis testing

 Type I Error : Rejecting the null hypothesis H

0

 

P

(

type I error

)  When it is true Called significance level Ex. The true mean equal to 50, but from the randomly selected samples, the test statistic falls in the critical region.  Type II Error : Failing to reject the null hypothesis when it is false  

P

(

type II error

) Ex. The true mean not equal to 50, but from the randomly selected samples, the test statistic falls in the acceptance region.

Hypothesis testing

  How to calculate the P(type I error)? Suppose   2 .

5   50  

P

(

X

P

(

Z

  48 .

5 |   50 ) 

P

(

X

48 .

5 2 .

5 /  50 ) 10 

P

(

Z

 51 .

5 |   50 )  51 .

5 2 .

5 /  50 ) 10  0 .

0574  How to calculate the P(type II error)? Suppose   2 .

5   50   Suppose   52  

P

( 48 .

5  

P

(

Z X

 51 .

5 |   51 .

5 2 .

5 /  52 ) 10 

P

(

Z

 52 )  48 .

5 2 .

5 /  52 ) 10  0 .

2643

Hypothesis testing

3.

4.

2.

1.

Discussion about type I and type II error The size of critical region (consequently to ) can be reduced by appropriate selection of the critical value.

 , A decreasing of type I error always results in an increasing of type II error, when n does not change.

An increasing in sample size n reduces type II error, when given type I constant.

The value of type II error decreased as the difference between the true mean and the hypothesized value increases.

Hypothesis testing

   Power is computed as 1   Power can be interpreted as the probability of correctly rejecting a false null hypothesis. Power is the descriptive and concise measurement of the sensitivity of the statistical test.

Hypothesis testing

 Two-sided alternative hypothesis  

H0: µ=50 cm/s H1: µ≠50 cm/s

 One-sided alternative hypothesis 

H0: µ=50 cm/s

H1: µ>50 cm/s or H1: µ<50 cm/s

Hypothesis testing

  P-Value : the smallest level of significance that would lead to reject the null hypothesis with the given data.

 Consider the two-sided hypothesis test

H0: µ=50 cm/s H1: µ≠50 cm/s

With n=16 and sd = 2.5. Suppose that the observed sample mean is 51.3. The P-value is the  that make 51.3 (and 48.7) => critical value

P

value

 1 

P

( 48 .

7 

X

 51 .

3 )  1   1 

P

( 48 .

7 2 .

5 /

P

(  2 .

08  50 10 

Z

 

Z

2 .

 08 ) 51 .

3 2 .

5 /  50 ) 10  1  0 .

962  0 .

038

Hypothesis testing

 Process of hypothesis testing  Identify the parameter of interest  State H0 and H1  Choose a significance level   Determine an appropriate test statistic  State the rejection region for the statistic  Compute the statistic value  Decide whether or not H0 should be rejected.

Test on the mean of a normal distribution variance know  Hypothesis

H

0

H

1 :  :     0  0  Test Statistic

Z

0 

X

 /   0

n

 We should reject H 0 

Z

 / 2

or Z

0  

Z

 / 2

Test on the mean of a normal distribution variance know  1.

2.

3.

4.

5.

Ex. Aircrew escape system are powered by a solid propellant. The burning rate of this propellant is an important product characteristic. The specifications require that the mean burning rate must be 50 cm/s. We know that the sd for burning rate is 2 cm/s. The experimenter decides to specify a significance level of n=25 and obtain average burning rate of =51.3 cm/s. What conclusion should be drawn?

 =0.05 and selects a random sample of

x

Parameter of interest if mean of the burning rate H0: µ=50 cm/s, H1: µ≠50 cm/s  =0.05

Test statistic reject H0 if

Z

0

Z

0  

X

Z

 /  / 2  0

n or Z

0  

Z

 / 2

Test on the mean of a normal distribution variance know

z

0

z

 / 2  51 .

3  50  2 /

z

0 .

025 25   3 1 .

96 , .

25

z

  / 2 

z

 0 .

025   1 .

96    Since Z 0 =3.25 >1.96, we reject H 0 at the 0.05 level of significance. We conclude that the mean burning rate differs from 50 cm/s based on a sample of 25 measurements. There is a strong evidence that the mean burning rate exceeds 50 cm/s

Test on the mean of a normal distribution variance know  Probability of a type II error for 2 sided-test δ = µ-µ 0  Sample size can be calculated by  Formulas  Operating Characteristic Curves (OC curve)   Y-axis => ß X-axis =>

d

 |     0 |  |   |

Test on the mean of a normal distribution variance know

  Ex From previous example. Suppose that the true burning rate is 49 cm/s. What is ß for the 2-sided test with  =0.05,  =2, and n=25 Form previous example µ 0 =50,    | 50  49 |  1        ( 1 .

96  25 )  2  (  1 .

96  25 ) 2   (  0 .

54 )   (  4 .

46 )  0 .

295 Conclusion: the probability of 0.295 that the test will fail to reject the null hypothesis when the true burning rate is 49 cm/s Suppose that the analyst wish to design the test that: if the mean burning rate differs from 50 cm/s by as much as 1 cm/s, the test will detect this with high probability of 0.90. What is the sample size required?

Now   2 ,  By formula,  1 ,   0 .

05 ,   1  0 .

90  0 .

10

n

 (

z

 / 2 

z

 ) 2  2  2  ( 1 .

96  1 .

28 ) 2 2 2 1 2  42

Test on the mean of a normal distribution variance know

 By using OC curve:

d

 |   0 |  1 / 2  0 .

5 ß=0.10

n

 40

Test on the mean of a normal distribution variance know  Large Sample Test: We may not be certain that the population is well modeled by a normal distribution . In this case if n is large (n>40) the sample sd. s can be substituted for  in the test procedures.

Test on the mean of a normal distribution, variance unknown  Hypothesis

H

0

H

1 :  :     0  0  Test Statistic

T

0 

X

  0

S

/

n

 We should reject H 0

t

 / 2 ,

n

 1

or t

0  

t

 / 2 ,

n

 1

Test on the mean of a normal distribution, variance unknown  Ex. It is of interest to determine if there is evidence (with  =0.05) to support a claim that the mean coefficient of restitution exceeds 0.82. The observations follow: 1.

2.

3.

4.

5.

6.

7.

Parameter of interest is the mean coefficient of restitution, µ

H

0 :   0 .

82 ;

H

1 :   0 .

82  =0.05

The test statistic is

t

0 

x

  0

s

/

n

Reject H 0 if t 0 >t 0.05,14 =1.761 Calculate t 0

t

0  0 .

83725 0 .

02456  / 0 .

82 15  2 .

72 Conclusion: Since t 0 =2.72>1.761, we reject H 0 and conclude that at the 0.05 level of significance the mean coefficient of restitution exceeds 0.82

Test on the mean of a normal distribution, variance unknown  P value for a t-test Ex From data in the previous example, Find P-value.

From table of t-test based on 14 degrees of freedom Notice that t 0 =2.72 is between 2.624 and 2.977, therefore the P-value must be between 0.01 and 0.005. By comparing critical value and tail area we found that P-value = 0.008

If the test is two-tailed test, the P-value would be 0.01

Test on the mean of a normal distribution, variance unknown

  Sample size can be approximated by using OC curve for t distribution Ex. From previous example, if the mean coefficient of restitution exceeds 0.82 by as much as 0.02, is the sample size n=15 adequate to ensure that H0: µ=0.82 will be rejected with probability at least 0.8.

 

d

  

s

 |   | 0 .

15 0 .

02456 ,   0 .

2  0 .

02 ,   0 .

02 / 0 .

02456   0 .

05 ,

n

 15 0 .

81 n=15 is adequate to make ß<0.2

  0 .

15

Test on the variance and standard deviation of a normal distribution  Hypothesis

H

0

H

1 :  :      0 0  Test Statistic  0 2  (

n

 1 )

S

2  0 2  We should reject H 0 if  0 2   2  / 2 ,

n

 1

or

 0 2   1 2   / 2 ,

n

 1

Test on the variance and standard deviation of a normal distribution 1.

2.

3.

4.

 5.

6.

7.

Ex. An automatic filling machine is used to fill bottles with liquid drtergent. A random sampling of 20 bottles results in a sample variance of fill volume of S 2 =0.0153 oz 2 . If the variance of fill volume exceeds 0.01 oz 2 , an unaccepatble proportion of bottles will be underfilled or overfilled. Is there evidence in the sample data to suggest that the manufacturer has a problem with underfilled or overfilled bottles? Use  =0.05, and assume that fill volume has a normal distribution.

The parameter of interest is the population variance  2

H

0 :  2  0 .

01 ;

H

1 :  2  0 .

01  =0.05

Test statistic is Reject H 0 Compute if  2 0   2 0  2 0  19 (   2 (

n

  0 .

05 , 19 1 )

S

2 0  2 30 .

14 0 .

0153 )  29 .

07 0 .

01 Conclusion: since , we conclude that there is no strong 0 0 .

05 , 19 evidence that the variance of fill volume exceeds 0.01 oz 2

Test on the variance and standard deviation of a normal distribution

   Sample size: using OC curves for chi square with X-axis =   =  /  0 Ex. Form previous ex, H0:  0 =0.10, suppose that if the true sd of the filling process exceeds this value by 25%, we would like to detect this with probability at least 0.8. Is the sample size of n=20 adequate?

     0   0 .

68

power

0 .

125 0 .

10  1    1 .

25  0 .

22  0 .

8 n=20 is not adequate!

We must increase n to decrease ß,

n

 70

Test on a population proportion

 Hypothesis

H

0 :

p

H

1 :

p

p p

0 0  Test Statistic

Z

0 

X np

0 

np

0 ( 1 

p

0 )  We should reject H 0 

z

 / 2

or z

0  

z

 / 2

Test on a population proportion

1.

2.

3.

4.

5.

6.

7.

 Ex. A semiconductor manufacturer produces controllers used un automobile engine applications. The customer requires that the process fallout or fraction defective at a critical manufacturing step not exceed 0.05 and that the manufacturer demonstrate process capability at this level of quality using customer.

 =0.05. The semiconductor manufacturer takes a random sample of 200 devices and finds that four of them are defective. Can the manufacturer demonstrate process capability for the The parameter of interest is the process fraction defective p.

H

0 :

p

 0 .

05 ;

H

1 :

p

 0 .

05  =0.05

Z

X np

0  ( 1

np

0

p

0 0 =0.05

Reject H0: p=0.05 if z 0 <-z 0.05

=-1.645

Computations:

Z

0  4  200 200 ( 0 .

05 ) * 0 .

05 * 0 .

95   1 .

95 Conclusion: Since z 0 <-z 0.05

, we reject H0 and conclude that the process fraction defective p is less than 0.05. P-value=0.0256, which is less than  =0.05.

Test on a population proportion

 Sample size:

Homework

1.

The sodium content of thirty 300-gram boxes of organic corn flakes was determined. The data (in mg.) are as follows: 131.15

128.77

130.14

130.42

131.15

128.77

130.69

130.72

129.29

129.53

130.69

130.72

130.91

128.33

128.71

130.12

130.91

128.33

129.54

128.24

129 129.78

129.54

128.24

129.64

129.65

129.39

130.92

129.64

129.65

a) Can you support a claim that mean sodium content of this brand of corn flakes differs from 130 mg? use  =0.05. Find the P-value.

b) Check the sodium content is normally distributed.

c) Compute the power of the test if the true mean sodium content is 130.5 mg.

d) What sample size would be required to detect a true mean sodium content of 130.1 mg. if we waned the power of the test to be at least 0.75?

e) From question in a), construct a two-sided confidence interval on the mean sodium content.