2 The sign test

The sign test is used to test hypotheses concerning the median of a continuous distribution. Some authors use the symbol θ to represent to median of the distribution - remember that μ is used to represent the mean of a distribution. We will use the θ notation for the median throughout this Workbook. Remember that in the case of a normal distribution the mean is equal to the median and so the sign test can be used to test hypotheses concerning the mean of a normal distribution. The test procedure is straightforward to describe. The usual null hypothesis is

H 0 : θ = θ 0

As you might expect, the alternative hypothesis can take one of three forms

H 1 : θ θ 0 H 1 : θ > θ 0 H 1 : θ < θ 0

Now suppose the sample taken from a population is X 1 , X 2 , X 3 , , X n . We form the differences

X i θ 0 i = 1 n

Assuming that the null hypothesis is true, each difference X i θ 0 is equally likely to be positive or negative and in order to test a particular pair of hypotheses we need only test the number of plus signs (say). Under the null hypothesis this is a value of the binomial distribution with parameter p = 1 2 . In order to decide whether we should reject a null hypothesis, we can calculate probabilities directly from the binomial distribution (see HELM booklet  37) using the formula

P ( X = r ) = n r q n r p r = n r ( 1 p ) n r p r

or by using the normal approximation to the binomial distribution.

The following Examples and Tasks illustrate the test procedure.

Example 1

The compressive strength of insulating blocks used in the construction of new houses is tested by a civil engineer.

The engineer needs to be certain at the 5% level of significance that the median compressive strength is at least 1000 psi. Twenty randomly selected blocks give the following results:

Observation Compressive Strength Observation Compressive Strength Observation Compressive Strength Observation Compressive Strength
1 1128.7 6 718.4 11 1167.1 16 1153.6
2 679.1 7 787.4 12 1387.5 17 1423.3
3 1317.2 8 1562.3 13 679.9 18 1122.6
4 1001.3 9 1356.9 14 1323.2 19 1644.3
5 1107.6 10 1153.2 15 788.4 20 737.4

Test (at the 5% level of significance) the null hypothesis that the median compressive strength of the insulting blocks is 1000 psi against the alternative that it is greater.

Solution

The hypotheses are

H 0 : θ = 1000 H 1 : θ > 1000

Comp. Strength Sign Comp. Strength Sign Comp. Strength Sign Comp. Strength Sign
1128.7 + 718.4 1167.1 + 1153.6 +
679.1 787.4 1387.5 + 1423.3 +
1317.2 + 1562.3 + 679.9 1122.6 +
1001.3 + 1356.9 + 1323.2 + 1644.3 +
1107.6 + 1153.2 + 788.4 737.4

We have 14 plus signs and the required probability value is calculated directly from the binomial formula as

P ( X 14 ) = r = 14 20 20 r 1 2 20 r 1 2 r = 20 . 19 . 18 . 17 . 16 . 15 1 . 2 . 3 . 4 . 5 . 6 1 2 20 + 20 . 19 . 18 . 17 . 16 1 . 2 . 3 . 4 . 5 1 2 20 + 20 . 19 . 18 . 17 1 . 2 . 3 . 4 1 2 20 + 20 . 19 . 18 1 . 2 . 3 1 2 20 + 20.19 1.2 1 2 20 + 20 1 1 2 20 + 1 20 20 = 1 2 20 ( 38760 + 15504 + 4845 + 1140 + 190 + 20 + 1 ) = 0.05766

Since we are performing a one-tailed test, we must compare the calculated value with the value 0.05.

Since 0.05 < 0.05766 we conclude that we cannot reject the null hypothesis and that on the basis of the available evidence, we cannot conclude that the median compressive strength of the insulating blocks is greater than 1000 psi.

Example 2

A certain type of solid rocket fuel is manufactured by bonding an igniter with a propellant. In order that the fuel burns smoothly and does not suffer either “flame-out” or become unstable it is essential that the material bonding the two components of the fuel has a shear strength of 2000 psi. The results arising from tests performed on 20 randomly selected samples of fuel are as follows:

Observation Shear Strength Observation Shear Strength Observation Shear Strength Observation Shear Strength
1 2128.7 6 1718.4 11 2167.1 16 2153.6
2 1679.1 7 1787.4 12 2387.5 17 2423.3
3 2317.2 8 2562.3 13 1679.9 18 2122.6
4 2001.3 9 2356.9 14 2323.2 19 2644.3
5 2107.6 10 2153.2 15 1788.4 20 1737.4

Using the 5% level of significance, test the null hypothesis that the median shear strength is 2000 psi.

Solution

The hypotheses are H 0 : θ = 2000 H 1 : θ 2000

We determine the signs associated with each observation as shown below and perform a two-tailed test.

Shear Strength Sign Shear Strength Sign Shear Strength Sign Shear Strength Sign
2128.7 + 1718.4 2167.1 + 2153.6 +
1679.1 1787.4 2387.5 + 2423.3 +
2317.2 + 2562.3 + 1679.9 2122.6 +
2001.3 + 2356.9 + 2323.2 + 2644.3 +
2107.6 + 2153.2 + 1788.4 1737.4

We have 14 plus signs and the required probability value is calculated directly from the binomial formula:

P ( X 14 ) = r = 14 20 20 r 1 2 20 r 1 2 r = 20 . 19 . 18 . 17 . 16 . 15 1 . 2 . 3 . 4 . 5 . 6 1 2 20 + 20 . 19 . 18 . 17 . 16 1 . 2 . 3 . 4 . 5 1 2 20 + 20 . 19 . 18 . 17 1 . 2 . 3 . 4 1 2 20 + 20 . 19 . 18 1 . 2 . 3 1 2 20 + 20.19 1.2 1 2 20 + 20 1 1 2 20 + 1 2 20 = 1 2 20 ( 38760 + 15504 + 4845 + 1140 + 190 + 20 + 1 ) = 0.05766

Since we are performing a two-tailed test, we must compare the calculated value with 0.025.

Since 0.025 < 0.05766 we cannot reject the null hypothesis on the basis of the evidence and conclude that the median shear strength is not significantly different from 2000 psi. Now do the following Task.

Task!

A certain type of solid rocket fuel is manufactured by binding an igniter with a propellant. In order that the fuel burns smoothly and does not suffer either “flame-out” or become unstable it is essential that the material bonding the two components of the fuel has a shear strength of 2000 psi. The results arising from tests performed on 10 randomly selected samples of fuel are as follows.

Observation Shear Strength Observation Shear Strength
1 2128.7 6 1718.4
2 1679.1 7 1787.4
3 2317.2 8 2562.3
4 2001.3 9 2356.9
5 2107.6 10 2153.2

Using the 5% level of significance, test the null hypothesis that the median shear strength is 2000 psi.

The hypotheses are

H 0 : θ = 2000 H 1 : θ 2000

We determine the signs associated with each observation as shown below and perform a two-tailed test.

Shear Strength Sign Shear Strength Sign
2128.7 + 1718.4
1679.1 1787.4
2317.2 + 2562.3 +
2001.3 + 2356.9 +
2107.6 + 2153.2 +

We have 7 plus signs and the required probability value is calculated directly from the binomial formula as

P ( X 7 ) = r = 7 10 10 r 1 2 10 r 1 2 r = 10 . 9 . 8 1 . 2 . 3 1 2 10 + 10.9 1.2 1 2 10 + 10 1 1 2 10 + 1 2 10 = 1 2 10 ( 120 + 45 + 10 + 1 ) &simeq; 0.172

Since we are performing a two-tailed test, we must compare the calculate value with the value 0.025. Since 0.025 < 0.172 we cannot reject the null hypothesis on the basis of the available evidence and we cannot conclude that the median shear strength is different to 2000 psi.