# Non-parametric Hypothesis Testing Procedureshaalshraideh/Courses/IE347/Non...Non-parametric...

Embed Size (px)

### Transcript of Non-parametric Hypothesis Testing Procedureshaalshraideh/Courses/IE347/Non...Non-parametric...

Non-parametric Hypothesis Testing

ProceduresProcedures

Hypothesis Testing

General Procedure for Hypothesis Tests

1. Identify the parameter of interest.

2. Formulate the null hypothesis, H0 .

3. Specify an appropriate alternative hypothesis, H1.

4. Choose a significance level, α.

5. Determine an appropriate test statistic.

6. State the rejection criteria for the statistic.

7. Compute necessary sample quantities for calculating the test statistic.

8. Draw appropriate conclusions.

2Sec 9-1 Hypothesis Testing

9-7 Testing for Goodness of Fit

• The test is based on the Chi-square distribution.

• Assume there is a sample of size n from a population whose

probability distribution is unknown.

• Let Oi be the observed frequency in the i-th class interval.

• Let Ei be the expected frequency in the i-th class interval.• Let Ei be the expected frequency in the i-th class interval.

The test statistic is

(9-16)

3Sec 9-7 Testing for Goodness of Fit

∑=

−=

k

i i

ii

E

EOX

1

220

)(

9-7 Testing for Goodness of Fit

EXAMPLE 9-12 Printed Circuit Board Defects

Poisson Distribution

The number of defects in printed circuit boards is hypothesized to follow a

Poisson distribution. A random sample of n = 60 printed boards has been

collected, and the following number of defects observed.

4Sec 9-7 Testing for Goodness of Fit

Number of

Defects

Observed

Frequency

0 32

1 15

2 9

3 4

9-7 Testing for Goodness of Fit Example 9-12

The mean of the assumed Poisson distribution in this example is unknown and

must be estimated from the sample data. The estimate of the mean number of

defects per board is the sample average, that is, (32*0 + 15*1 + 9*2 + 4*3)/60 =

0.75. From the Poisson distribution with parameter 0.75, we may compute pi, the

theoretical, hypothesized probability associated with the i-th class interval. Since

each class interval corresponds to a particular number of defects, we may find the

pi as follows:

( )472.0

75.0)0(

075.0

====−

eXPp

5Sec 9-7 Testing for Goodness of Fit

( )

( )

( )

( ) 041.01)3(

133.0!2

75.0)2(

354.0!1

75.0)1(

472.0!0

75.0)0(

3214

275.0

3

175.0

2

1

=++−=≥=

====

====

====

−

−

pppXPp

eXPp

eXPp

eXPp

9-7 Testing for Goodness of Fit Example 9-12

The expected frequencies are computed by multiplying the sample size n = 60

times the probabilities pi. That is, Ei = npi. The expected frequencies follow:

Number of Defects Probability

Expected

Frequency

0 0.472 28.32

1 0.354 21.24

6Sec 9-7 Testing for Goodness of Fit

1 0.354 21.24

2 0.133 7.98

3 (or more) 0.041 2.46

9-7 Testing for Goodness of Fit Example 9-12

Since the expected frequency in the last cell is less than 3, we combine the

last two cells:

Number of

Defects

Observed

Frequency

Expected

Frequency

0 32 28.32

1 15 21.24

2 (or more) 13 10.44

7Sec 9-7 Testing for Goodness of Fit

The chi-square test statistic in Equation 9-16 will have k− p − 1 = 3 −1 − 1 = 1

degree of freedom, because the mean of the Poisson distribution was

estimated from the data.

2 (or more) 13 10.44

9-7 Testing for Goodness of Fit Example 9-12

The eight-step hypothesis-testing procedure may now be applied, using

α = 0.05, as follows:

1. Parameter of interest: The variable of interest is the form of the distribution

of defects in printed circuit boards.

2. Null hypothesis: H0: The form of the distribution of defects is Poisson.

8Sec 9-7 Testing for Goodness of Fit

3. Alternative hypothesis: H1: The form of the distribution of defects is not

Poisson.

4. α = 0.05

5. Test statistic: The test statistic is

( )∑=

20

−=χ

k

i i

ii

E

Eo

1

2

9-7 Testing for Goodness of Fit Example 9-12

6. Reject H0 if: Reject H0 if the P-value is less than 0.05.

7. Computations:

( ) ( )

( )94.2

44.10

44.1013

24.21

24.2115

32.28

32.2832

2

22

=−

+

−+

−=χ 2

0

9Sec 9-7 Testing for Goodness of Fit

8. Conclusions: We find from Appendix Table III that and

. Because lies between these values, we conclude

that the P-value is between 0.05 and 0.10. Therefore, since the P-value

exceeds 0.05 we are unable to reject the null hypothesis that the distribution

of defects in printed circuit boards is Poisson. The exact P-value computed

from Minitab is 0.0864.

71.22 =χ 0.10,1

84.32 =χ0.05,1 94.2=χ 20

Minitab

9-9 Nonparametric Procedures

0 0 1 0: :H Hµ µ µ µ= <% % % %

0iX µ− %

11Sec 9-9 Nonparametric Procedures

0 0 1 0: :H Hµ µ µ µ= ≠% % % %

Montgomery, Peck, and Vining (2012) reported on a study in which a rocket motor is

formed by binding an igniter propellant and a sustainer propellant together inside a metal

housing. The shear strength of the bond between the two propellant types is an important

characteristic. The results of testing 20 randomly selected motors are shown in Table 9-5. Test the hypothesis that the median shear strength is 2000 psi, using α = 0.05.

EXAMPLE 9-15 Propellant Shear Strength Sign Test

Table 9-5 Propellant Shear Strength Data

Observationi

Shear Strength

xi

Differencesxi - 2000

Sign

1 2158.70 158.70 +

2 1678.15 –321.85 –

3 2316.00 316.00 +

4 2061.30 61.30 +

12

4 2061.30 61.30 +

5 2207.50 207.50 +

6 1708.30 –291.70 –

7 1784.70 –215.30 –

8 2575.10 575.10 +

9 2357.90 357.90 +

10 2256.70 256.70 +

11 2165.20 165.20 +

12 2399.55 399.55 +

13 1779.80 –220.20 –

14 2336.75 336.75 +

15 1765.30 –234.70 –

16 2053.50 53.50 +

17 2414.40 414.40 +

18 2200.50 200.50 +

19 2654.20 654.20 +

20 1753.70 –246.30 –

Sec 9-9 Nonparametric Procedures

The eight-step hypothesis-testing procedure is:

1. Parameter of Interest: The variable of interest is the median of the distribution

of propellant shear strength.

2. Null hypothesis:

3. Alternative hypothesis:

4. α= 0.05

5. Test statistic: The test statistic is the observed number of plus differences in

EXAMPLE 9-15 Propellant Shear Strength Sign Test - Continued

0 : 2 0 0 0 p s iH µ =%

1 : 2 0 0 0 p s iH µ ≠%

13

5. Test statistic: The test statistic is the observed number of plus differences in

Table 9-5, i.e., r+ = 14.

6. Reject H0 : If the P-value corresponding to r+ = 14 is less than or equal to

α= 0.05

7. Computations : r+ = 14 is greater than n/2 = 20/2 = 10.

P-value :

8. Conclusions: Since the P-value is greater than α= 0.05 we cannot reject

the null hypotheses that the median shear strength is 2000 psi.

( ) ( )2 0

2 0

1 4

12 1 4 w h e n

2

2 02 0 . 5 0 . 5

0 . 1 1 5 3

r r

r

P P R p

r

+

−

=

= ≥ =

=

=

∑

Sec 9-9 Nonparametric Procedures

•R=min(R+,R--)•Reject if R ≤ r*

Minitab

9-9 Nonparametric Procedures

9-9.2 The Wilcoxon Signed-Rank Test

• A test procedure that uses both direction (sign) and magnitude.

• Suppose that the hypotheses are

Test procedure : Let X1, X2,... ,Xn be a random sample from continuous and symmetricdistribution with mean (and Median) μ. Form the differences .

• Rank the absolute differences in ascending order, and give the ranks

to the signs of their corresponding differences.

0iX µ−

0 0 1 0: :H Hµ µ µ µ= ≠

0iX µ−

16

to the signs of their corresponding differences.

• Let W+ be the sum of the positive ranks and W– be the absolute value of the sum of the

negative ranks, and let W = min(W+, W−).

Critical values of W, can be found in Appendix Table IX.

• If the computed value is less than the critical value, we will reject H0 .

• For one-sided alternatives reject H0 if W– ≤ critical value

reject H0 if W+ ≤ critical value1 0:H µ µ>

1 0:H µ µ<

Sec 9-9 Nonparametric Procedures

Sec 9- 17

Let’s illustrate the Wilcoxon signed rank test by applying it to the propellant shear strength

data from Table 9-5. Assume that the underlying distribution is a continuous symmetric

distribution. Test the hypothesis that the mean shear strength is 2000 psi, using α = 0.05.

The eight-step hypothesis-testing procedure is:

1. Parameter of Interest: The variable of interest is the mean or median of the

distribution of propellant shear strength.

2. Null hypothesis:

EXAMPLE 9-16 Propellant Shear Strength-Wilcoxon Signed-Rank Test

0 : 2 0 0 0 p siH µ =

18

3. Alternative hypothesis:4. α = 0.05

5. Test statistic: The test statistic is W = min(W+, W−)

6. Reject H0 if: W ≤ 52 (from Appendix Table IX).

7. Computations : The sum of the positive ranks is

w+ = (1 + 2 + 3 + 4 + 5 + 6 + 11 + 13 + 15 + 16 + 17 + 18 + 19 + 20) = 150, and the

sum of the absolute values of the negative ranks is

w- = (7 + 8 + 9 + 10 + 12 + 14) = 60.

1 : 2 0 0 0 p s iH µ ≠

Sec 9-9 Nonparametric Procedures

EXAMPLE 9-16 Propellant Shear Strength-Wilcoxon Signed-Rank Test

Observationi

Differencesxi - 2000

Signed Rank

16 53.50 1

4 61.30 2

1 158.70 3

11 165.20 4

18 200.50 5

5 207.50 6

7 –215.30 –7

13 –220.20 –8

15 –234.70 –9

20 –246.30 –10

10 256.70 11

19

W = min(W+, W−) = min(150 , 60) = 60

7. Conclusions: Since W = 60 is not ≤ 52 we fail to reject the null hypotheses that the mean

or median shear strength is 2000 psi.

10 256.70 11

6 –291.70 –12

3 316.00 13

2 –321.85 –14

14 336.75 15

9 357.90 16

12 399.55 17

17 414.40 18

8 575.10 19

19 654.20 20

Sec 9-9 Nonparametric Procedures

Minitab

Note: Minitab uses a modified procedure of the Wilcoxon Signed Rank test.

10-3 Wilcoxon Rank-Sum Test

• X1 and X2 with means µ1 and µ2, but we are unwilling to

assume that they are (approximately) normal.

• Want to test:• Want to test:

• Let X11, X12,...,X1n1 and X21, X22,...,X2n2 be two

independent random samples of sizes

21

21 nn ≤

Procedure

• Arrange all n1 + n2 observations in ascending order of

magnitude and assign ranks to them.

– If two or more observations are tied (identical), use

the mean of the ranks that would have been assigned

if the observations differed.if the observations differed.

• Let W1 be the sum of the ranks in the smaller sample (1),

and define W2 to be the sum of the ranks in the other

sample. Then,

22

Procedure

• Get the critical value (wα) from Appendex

Table X

• Reject if either w or w is less than w• Reject if either w1

or w2

is less than wα

– For , reject H0 if w1≤ wα

– for , reject H0 if w2 ≤ wα

23

211 µ µ : H <

211 µ µ : H >

Table X

24

Table X

25

Example

• The mean axial stress in tensile members used in an aircraft structure is being

studied. Two alloys are being investigated. Alloy 1 is a traditional material, and

alloy 2 is a new aluminum-lithium alloy that is much lighter than the standard

material. Ten specimens of each alloy type are tested, and the axial stress is

measured. The sample data are assembled in Table 10-2. Using α= 0.05, we

wish to test the hypothesis that the means of the two stress distributions are

identical.identical.

26

Example

1. Parameter of interest: The parameters of interest are the means of the two

distributions of axial stress.

2. Null hypothesis: H0

: µ1

= µ2

.

3. Alternative hypothesis: H1

: µ1≠ µ

23. Alternative hypothesis: H1

: µ1≠ µ

2

4.α=0.05

5. Test statistic: We will use the Wilcoxon rank-sum test statistic in Equation 10-

21.

27

Example6. Rejection criteria :

If either w1 or w2 is less than or equal to

w0.05

= 78, we will reject H0: µ1 = µ2.

7. Computations:

8. Since both w1

and w2

> 78

We cannot reject H0

.

28

Minitab

Note: Another name for Wilcoxon Rank-Sum test is Mann-Whitney U-test