1 Tests concerning two samples
Two independent populations each with a known variance
We assume that the populations are normally distributed. This may not always be true and you should note this basic assumption while studying this Section of the Workbook.
A standard notation often used to describe the populations and samples is:
Population | Sample |
with members. | |
with members. | |
If you are not familiar with the double suffix notation used to represent the samples, simply remember that a random sample of size is drawn from and a random sample of size is drawn from .
In diagrammatic form the populations may be represented as follows:
Figure 6
When we look at hypothesis testing using two means, we will be considering the difference of the means and writing null hypotheses of the form
Value
As you might expect, Value will often be zero and we will be trying to detect whether there is any statistically significant evidence of a difference between the means.
We know, from our previous work on continuous distributions (see HELM booklet 38) that:
and that
since and are independent. Given the assumptions made we can assert that the quantity defined by
follows the standard normal distribution .
We are now ready to apply this formula to practical problems in which random samples of different sizes are drawn from normal populations. The conditions for the rejection of at the 5% and the 1% levels of significance are exactly the same as those previously used for single sample problems.
Example 4
A motor manufacturer wishes to replace steel suspension components by aluminium components to save weight and thereby improve performance and fuel consumption. Tensile strength tests are carried out on randomly chosen samples of two possible components before a final choice is made. The results are:
Component | Sample | Mean Tensile | Standard Deviation |
Number | Size | Strength ( ) | ( ) |
1 | 15 | 90 | 2.3 |
2 | 10 | 88 | 2.2 |
Is there any difference between the measured tensile strengths at the 5% level of significance?
Solution
The null and alternative hypotheses are:
The null hypothesis represent the statement ‘there is no difference in the tensile strengths of the two components.’ The test statistic is calculated as:
Since we conclude that, on the basis of the (limited) evidence available, there is a difference in tensile strength between the components tested. The manufacturer should carry out more comprehensive tests before making a final decision as to which component to use. The decision is a serious one with safety implications as well as economic implications. As well as carrying out more tests the manufacturer should consider the level of rejection of the null hypothesis, perhaps using 1% instead of 5%. Component 1 appears to be stronger but this may not be the case after more tests are carried out.
Task!
A motor manufacturer is considering whether or not a new fuel formulation will improve the maximum power output of a particular type of engine. Tests are carried out on randomly chosen samples of the two fuels in order to inform a decision. The results are:
Fuel | Sample | Mean Maximum | Standard Deviation |
Type | Size | Power Output (bhp) | (bhp) |
1 | 20 | 1350 | 10 |
2 | 16 | 131 | 8 |
Is there any difference between the measured power outputs at the 5% level of significance?
The null and alternative hypotheses are:
The null hypothesis represent the statement ‘there is no difference in the measured maximum power outputs’. The test statistic is calculated as:
Since we conclude that, on the basis of the (limited) evidence available, there is insufficient evidence to conclude that there is a difference in the maximum power output of the engines tested when run on the different types of fuel.
1.1 Two independent populations each with an unknown variance
Again we assume that the populations are normally distributed and use the same standard notation used previously to describe the populations and samples, namely:
Population | Sample |
with members. | |
with members. | |
There are two distinct cases to consider. Firstly, we will assume that although the variances are unknown, they are in fact equal. Secondly, we will assume that the unknown variances are not necessarily equal.
Case (i) - Unknown but equal variances
Again, when we look at hypothesis testing using two means, we will be considering the difference of the means and writing null hypotheses of the form
Value
and again Value will often be zero and we will be trying to detect whether there is any statistically significant difference between the means.
We will take so that in diagrammatic form the populations are:
Figure 7
The results from our work on continuous distributions (see HELM booklet 38) tell us that:
as before, and that
Given that we do not know the value of , we must estimate it. This is done by combining (or pooling) the sample variances say and for samples 1 and 2 respectively according to the formula:
Notice that
so that you can see that is a weighted average of and . In fact, each sample variance is weighted according to the number of degrees of freedom available. Notice also that the first sample contributes degrees of freedom and the second sample contributes degrees of freedom so that has degrees of freedom.
Since we are estimating unknown variances, the quantity defined by
will follow Student’s -distribution with degrees of freedom.
We are now ready to apply this formula to practical problems in which random samples of different sizes with unknown but equal variances are drawn from independent normal populations. The conditions for the rejection of at the 5% and the 1% levels of significance are found from tables of the -distribution (Table 2), a copy of which is included to the end of this Workbook.
Example 5
A manufacturer of electronic equipment has developed a circuit to feed current to a particular component in a computer display screen. While the new design is cheaper to manufacture, it can only be adopted for mass production if it passes the same average current to the component. In tests involving the two circuits, the following results are obtained.
Test Number | Circuit 1 - Current (mA) | Circuit 2 - Current (mA) |
1 | 80.1 | 80.7 |
2 | 82.3 | 81.3 |
3 | 84.1 | 84.6 |
4 | 82.6 | 81.7 |
5 | 85.3 | 86.3 |
6 | 81.3 | 84.3 |
7 | 83.2 | 83.7 |
8 | 81.7 | 84.7 |
9 | 82.2 | 82.8 |
10 | 81.4 | 84.4 |
11 | 85.2 | |
12 | 84.9 | |
On the assumption that the populations from which the samples are drawn have equal variances , should the manufacturer replace the old circuit design by the new one? Use the 5% level of significance.
Solution
If the average current flows are represented by and we form the hypotheses
The sample means are and .
The sample variances are and .
The pooled estimate of the variance is
The test statistic is
From -tables, the critical values with 20 degrees of freedom and a two-tailed test are . Since we conclude that we cannot reject the null hypothesis in favour of the alternative. A 95% confidence interval for the difference between the mean currents is given by . The confidence interval is .
Task!
A manufacturer of steel cables used in the construction of suspension bridges has experimented with a new type of steel which it is hoped will result in the cables produced being stronger in the sense that they will accept greater tension loads before failure. In order to test the performance of the new cables in comparison with the old cables, samples are tested for failure under tension. The following results were obtained, the failure tensions being given in kg .
Test Number | New Cable | Original Cable |
1 | 92.7 | 90.2 |
2 | 91.6 | 92.4 |
3 | 94.7 | 94.7 |
4 | 93.7 | 92.1 |
5 | 96.5 | 95.9 |
6 | 94.3 | 91.1 |
7 | 93.7 | 93.2 |
8 | 96.8 | 91.5 |
9 | 98.9 | |
10 | 99.9 | |
The cable manufacturer, on looking at health and safety legislation, decides that a 1% level of significance should be used in any statistical testing procedure adopted to distinguish between the cables. On the basis of the results given, should the manufacturer replace the old cable by the new one? You may assume that the populations from which the samples are drawn have equal variances .
If the average tensions are represented by (new cable) and (old cable) we form the hypotheses
in order to test the hypothesis that the new cable is stronger on average than the old cable.
The sample means are and .
The sample variances are and .
The pooled estimate of the variance is
The test statistic is
Using -distribution tables with 16 degrees of freedom, we see that the critical value at the 1% level of significance is 2.583. Since we conclude that we cannot reject the null hypothesis in favour of the alternative. However, the close result indicates that more tests should be carried out before making a final decision. At this stage the cable manufacturer should not replace the old cable by the new one on the basis of the evidence available. Case (ii) - Unknown and unequal variances
In this case we will take so that in diagrammatic form the populations may be represented as shown below.
Figure 8
Again, when we look at hypothesis testing using two means, we will be considering the difference of the means and writing null hypotheses of the form
Value
and again Value will often be zero and we will be trying to detect whether there is any statistically significant difference between the means.
In the case where we assume unequal variances, there is no exact statistic which we can use to test the validity or otherwise of the null hypothesis Value. However, the following approximation in Key Point 1 allows us to overcome this problem.
Key Point 1
Provided that the null hypothesis is true, the statistic
will approximately follow Student’s distribution with the number of degrees of freedom given by the expression:
Essentially, this means that the actual test procedure is similar to that used previously but with and the number of degrees of freedom calculated using the above formulae. We are now ready to apply these formulae to practical problems in which random samples of different sizes with unknown and unequal variances are drawn from independent normal populations. We will illustrate the test procedure by reworking an Example and Task done previously but we will assume unequal rather than equal variances.
This next Example is a repeat of Example 5 but here assuming unequal variances.
Example 6
A manufacturer of electronic equipment has developed a circuit to feed current to a particular component in a computer display screen. While the new design is cheaper to manufacture, it can only be adopted for mass production if it passes the same average current to the component. In tests involving the two circuits, the results are obtained are:
Test Number | Circuit 1 - Current (mA) | Circuit 2 - Current (mA) |
1 | 80.1 | 80.7 |
2 | 82.3 | 81.3 |
3 | 84.1 | 84.6 |
4 | 82.6 | 81.7 |
5 | 85.3 | 86.3 |
6 | 81.3 | 84.3 |
7 | 83.2 | 83.7 |
8 | 81.7 | 84.7 |
9 | 82.2 | 82.8 |
10 | 81.4 | 84.4 |
11 | 85.2 | |
12 | 84.9 | |
On the assumption that the populations from which the samples are drawn do not have equal variances , should the manufacturer replace the old circuit design by the new one? Use the 5% level of significance.
Solution
If the average current flows are represented by and we form the hypotheses
The sample means are and .
The sample variances are and .
The test statistic is
The number of degrees of freedom is given by
From -tables, the critical values (two-tailed test, 5% level of significance) are . Since we conclude that there is insufficient evidence to reject the null hypothesis in favour of the alternative at the 5% level of significance.
This next Task is a repeat of the Task on page 25 but assuming unequal variances.
Task!
A manufacturer of steel cables used in the construction of suspension bridges has experimented with a new type of steel which it is hoped will result in the cables produced being stronger in the sense that they will accept greater tension loads before failure. In order to test the performance of the new cables in comparison with the old cables, samples are tested for failure under tension. The results obtained are given below where the failure tensions are given in kg .
Test Number | New Cable | Original Cable |
1 | 92.7 | 90.2 |
2 | 91.6 | 92.4 |
3 | 94.7 | 94.7 |
4 | 93.7 | 92.1 |
5 | 96.5 | 95.9 |
6 | 94.3 | 91.1 |
7 | 93.7 | 93.2 |
8 | 96.8 | 91.5 |
9 | 98.9 | |
10 | 99.9 | |
The cable manufacturer, on looking at health and safety legislation, decides that a 1% level of significance should be used in any statistical testing procedure adopted to distinguish between the cables. On the basis of the results given and assuming that the populations from which the samples are drawn do not have equal variances , should the manufacturer replace the old cable by the new one?
If the average tensions are represented by (new cable) and (old cable), we form the hypotheses
in order to test the hypothesis that the new cable is stronger on average than the old cable.
The sample means are and .
The sample variances are and .
The test statistic is
The number of degrees of freedom is given by
Using -distribution tables with 18 degrees of freedom, we see that the critical value at the 1% level of significance is 2.552. Since we conclude that we reject the null hypothesis in favour of the alternative. Notice that the result could still be considered marginal. The cable manufacturer should exercise caution if the old cable is replaced by the new one on the basis of the evidence available.
1.2 The -test
In the tests above, we distinguished between the cases of equal and unequal variances of samples chosen from independent normal populations. As you have seen, the analysis changes according to the assumptions made, conclusions reached and recommendations made - accepting or rejecting a null hypothesis for example - may also change. In view of this, we may wish to test in order to decide whether the assumption that the variances and of the independent normal populations shown in the diagram below, may be regarded as equal.
Figure 9
Essentially, we will test the null hypothesis
against one of the alternatives
In order to do this, we use the -distribution. The hypothesis test for the equality of two variances and is encapsulated in the following Key Point.
Key Point 2
Consider a random sample of size taken from a normal population with mean and variance and a random sample of size taken from a second normal population with mean and variance . Denote the respective sample variances by and and assume that the populations are independent. The ratio
follows an distribution in which the numerator has degrees of freedom and the denominator has degrees of freedom.
Note that if the null hypothesis is true, then the value of reduces to the ratio of the sample variances and that in this case
Note
Recall that if a random sample of size is taken from a normal population with mean and variance and if the sample variance is denoted by , the random variable
has a distribution with degrees of freedom. Similarly, if a random sample of size is taken from a normal population with mean and variance and if the sample variance is denoted by , the random variable
has a distribution with degrees of freedom. This means that the ratio
is a ratio of random variables with degrees of freedom in the numerator and degrees of freedom in the denominator. Under the null hypothesis
we know that the expression for reduces to
and we say that has an -distribution with degrees of freedom in the numerator and degrees of freedom in the denominator. This distribution is denoted by
and some tabulated values are given in Tables 3 and 4 at the end of this Workbook.
If you check Tables 3 and 4, you will find that only right-tail values are given. The left-tail values are calculated by using the following formula:
Note the reversal in the order in which the expressions for the number of degrees of freedom occur.
Example 7
The following is an extract from the -distribution tables (5% tail) given at the end of this Workbook.
Figure 10
Write down or calculate as appropriate, the following values of from the table:
Right-tail Values | Left-tail Values |
Solution
The right-tail values are read directly from the tables. The left-tail values are calculated using the formula given above.
Right-tail Values | Left-tail Values |
Task!
Write down or calculate as appropriate, the following values of from the tables given at the end of this Workbook.
Right-tail Values | Left-tail Values |
Right-tail Values | Left-tail Values |
We are now in a position to use the -test to solve engineering problems. The application of the -test will be illustrated by using the data given in a previous worked example in order to determine whether the assumption of equal variability in the samples used is realistic. This next Example was met as Example 5 (page 24). Here we test one of the underlying assumptions.
Example 8
A manufacturer of electronic equipment has developed a circuit to feed current to a particular component in a computer display screen. While the new design is cheaper to manufacture, it can only be adopted for mass production if it passes the same average current to the component. In tests involving the two circuits, the results obtained are
Test Number | Circuit 1 - Current (mA) | Circuit 2 - Current (mA) |
1 | 80.1 | 80.7 |
2 | 82.3 | 81.3 |
3 | 84.1 | 84.6 |
4 | 82.6 | 81.7 |
5 | 85.3 | 86.3 |
6 | 81.3 | 84.3 |
7 | 83.2 | 83.7 |
8 | 81.7 | 84.7 |
9 | 82.2 | 82.8 |
10 | 81.4 | 84.4 |
11 | 85.2 | |
12 | 84.9 | |
In Example 5 we worked on the assumption that the populations from which the samples are drawn have equal variances. Is this assumption valid at the 5% level of significance?
Note that the manufacturer may also be interested in knowing whether the variances are equal as well as the means. We shall not address that problem here but it can be argued that equality of variances will facilitate consistent performance from the components.
Solution
We form the hypotheses
and perform a two-tailed test.
The sample variances are and .
The test statistic is
which has an -distribution with 9 degrees of freedom in the numerator and 11 degrees of freedom in the denominator.
We require two 2.5% tails, that is we require right-tail and left-tail . The latter may be approximated as follows:
Since we conclude that we cannot reject the null hypothesis in favour of the alternative at the 5% level of significance. The evidence supports the conclusion that the samples have equal variability.
Note that we can adopt the rule (many statisticians do this) of always dividing the larger value by the smaller value so that you only need to look up right tail values.
This next Task was first met on page 25. Here we test one of the underlying assumptions.
Task!
A manufacturer of steel cables used in the construction of suspension bridges has experimented with a new type of steel which it is hoped will result in the cables produced being stronger in the sense that they will accept greater tension loads before failure. In order to test the performance of the new cables in comparison with the old cables, samples are tested for failure under tension. The results obtained are as follows, where the failure tensions are given in tonnes.
Test Number | New steel cable tension | Old steel cable tension |
1 | 80.1 | 80.7 |
2 | 82.3 | 81.3 |
3 | 84.1 | 84.6 |
4 | 82.6 | 81.7 |
5 | 85.3 | 86.3 |
6 | 81.3 | 84.3 |
7 | 83.2 | 83.7 |
8 | 81.7 | 84.7 |
9 | 82.2 | 82.8 |
10 | 81.4 | 84.4 |
11 | 85.2 | |
12 | 84.9 | |
Last time we assumed that the populations from which the samples are drawn did not have equal variances. Is this assumption valid at the 5% level of significance?
We form the hypotheses
and perform a two-tailed test.
The sample variances are and .
The test statistic is
which has an -distribution with 9 degrees of freedom in the numerator and 7 degrees of freedom in the denominator. We require two 2.5% tails. That is, we require right-tail and left-tail which may be calculated as
Since we conclude that we cannot reject the null hypothesis in favour of the alternative at the 5% level of significance. The evidence does not support the conclusion that the populations have unequal variances.