ARG/PDW: MCEN4027F00 IV: 1 TESTS OF HYPOTHESES: INFERENCES BASED UPON TWO GROUPS Difference in Two Means One of the most common types of problems encountered concerns the question of whether there are differences in the means of two populations. We consider the case when two independent samples are drawn from distributions that are relatively normal or have moderately large sample sizes. Selecting the Test We will employ one basic test whereby the only distinction between several approaches depends upon the standard deviation. In particular we need to distinguish between the following situations: We know or do not know what the standard deviation is. We consider the standard deviations of the two populations to be equal or not equal. ARG/PDW: MCEN4027F00 IV: 2 The first question establishes the limit value and the second provides the test statistic. If we know the standard deviation, the limit is a z-value and we have a z-test. If we do not know the population standard deviation, then we must estimate it from the samples. We then use a t-limit and have a t-test. If the standard deviation is to be the same for both samples, then the z-test is somewhat simplified, as there is only one value of . For a t-test the variances must be evaluated to determine whether they are equal (F-test). If the F-test shows no difference, then the variances can be averaged (pooled variance) – a single estimate of . If the variances are not the same, then a different calculation scheme is employed. ARG/PDW: MCEN4027F00 IV: 3 Sampling Distributions The Student’s t Distribution The student’s t distribution is given by x t s n where x and s are the sample mean and standard deviation, is the population mean and n is the sample size. The student’s t distribution has = n - 1 degrees of freedom. The critical values for the t distribution are given in terms of and and , i.e. t,, and are tabulated in standard statistical tables. Here is the level of significance of the one-tailed test, i.e. the probability that a given value of t would be obtained by chance. ARG/PDW: MCEN4027F00 IV: 4 The F Distribution The F distribution is given by F s12 s22 where s1 and s2 are the means from two samples, 1 and 2. The F distribution has 1 = n1 - 1 degrees of freedom for the numerator and 2 = n2 - 1 degrees of freedom for the denominator. The critical values for the F distribution are given in terms of and , 1 and 2, i.e. F,1,2 and are tabulated in standard statistical tables. ARG/PDW: MCEN4027F00 IV: 5 The Hypothesis The appropriate hypothesis to be tested at a significance level is: There is no difference between the population means (1 = 2) where 1 and 2 represent the means of the first and second populations, respectively. The appropriate alternative hypothesis is: There is a difference between the population means: For a two-tailed test, 1 2. For a one-tailed test, 1 < 2 or 1 > 2. ARG/PDW: MCEN4027F00 IV: 6 Example 1 An experiment was conducted in which two groups of samples were subjected to heat treatments at two different temperatures for the same length of time. The effect of the heat treatments was determined by hardness measurements. The results are summarized in the following table. Experimental Results Heat Treatment Temperature (C) Rockwell Hardness (RB) Mean Standard Deviation T1 82, 76, 77, 84, 79, 86 80.7 3.98 T2 68,73, 77, 78, 70, 80 74.3 4.76 1. Can the variances be pooled? Use the F-test with: Ho: 12 22 ; H1: 12 22 Use sample variances to estimate population values: F s12 s22 15.9 0.700 22.7 Critical values of F-statistic at = 0.05 with df = 1 = 2 = 5: F0.025(1, 2) = F (5, 5) = 0.14; F0.975((1, 2) = F (5, 5) = 7.15 Decision: Since the test statistic is within the limit, we accept the null hypothesis and can therefore pool the variances. ARG/PDW: MCEN4027F00 IV: 7 2. Compare the sample means. Use the t-test with: Ho: 1 = 2; H1: 1 2 Calculate pooled variance: s 2p n1 1s12 n2 1s22 19.3 n1 n2 2 Calculate test statistic: X1 X 2 t 2.499 1 1 sp n1 n2 Critical value of t-statistic at = 0.05 with df = n1 + n2 –2 = 10: Upper limit: t1-/2 = t0.975 = 2.228 Lower limit: t/2 = t0.025 = -2.228 Decision: Since the test statistic is greater than the limiting value, we reject the null hypothesis and conclude that there is a significant difference in hardness due to the two heat treatments. ARG/PDW: MCEN4027F00 IV: 8 Example 2A An experiment was conducted in which a group of samples was subjected to a specific heat treatment. The effect of the heat treatment was determined by hardness measurements, and the concern was whether the results conformed to the expected (i.e., “theoretical”) hardness value of RB 80. The results are summarized in the following table. Experimental Results Heat Treatment Temperature (C) Rockwell Hardness (RB) Mean Standard Deviation T1 68,73, 77, 78, 70, 80 74.3 4.76 In general, our approach is governed by whether or not the population or theoretical standard deviation is known. If it is not (as in this case), we must estimate from the sample variance. ARG/PDW: MCEN4027F00 IV: 9 Compare the population means. Use the t-test with: Ho: = theoretical; H1: theoretical Calculate the test statistic (note that the formulation of the test statistic is based upon a population assumption; consequently, n2 is very large () and only n1 = n appears in the calculation: t X theo 74.3 80 2.93 s n 4.76 6 Critical value of the t-statistic at = 0.05 with df = n–1 = 5: Upper limit: t1-/2 = t0.975 = 2.571 Lower limit: t/2 = t0.025 = -2.571 Decision: Since the test statistic is less than the limit (i.e., outside of the range), we reject the null hypothesis and conclude that there is a difference in hardness between the sample and “theoretical” value. ARG/PDW: MCEN4027F00 IV: 10 Example 2B The capacity of insulation to block the flow of heat is customarily measured by its R value. To test a manufacturer’s claim that a new insulating material possesses an R value of 3.8 per inch of thickness and therefore is suitable for meeting the most stringent building codes, 5 test measurements will be taken, each on a specimen of a different production batch. Although it will be assumed that the measurement process is normally distributed, the newness of the product makes it likely that a good estimate of the variance is lacking. If the five measurements provide values of 3.9, 3.8, 4.0, 4.1, and 4.2, should the new insulation be placed on the approved list? Solution 1. Hypothesis Test Ho: = 3.8 Ha: 3.8 2. Level of Significance Assuming there is no reason to demand an especially stringent level of significance, let = 0.05. 3. Test Statistic Normality allows use of the t test with 5-1 = 4 degrees of freedom. The test statistic is given by t X 3 .8 S n 4. Sample Size: n = 5 5. Critical Region: Obtain from tables. ARG/PDW: MCEN4027F00 IV: 11 Since t/2,n-1 = t0.025,4 = 2.776, the resulting critical region is C = {t: t -2.776 or t -2.776} 6. Sample Value Suppose the 5 measurements are 3.9, 3.8, 4.0, 4.1, 4.2; then x = 4.0 and s = 0.158. Consequently, the sample value of the test statistic is t X 3.8 4.0 3.8 2.830 S 5 0.158 5 7. Decision: Reject Ho since t > 2.776. Example 3 An experiment was conducted in which a group of samples was subjected to a specific heat treatment. Since the effect of the heat treatment was determined by hardness measurements (the response variable), advantage can be made of the fact that this measurement is nondestructive. The results are summarized in the following table for hardness test values on six different specimens before and after the treatment (one hardness-test for each condition). Experimental Results Heat Treatment at Temperature T (C) Rockwell Hardness (RB) Before 82, 76, 77, 84, 79, 86 After 70, 80, 78, 77, 68, 73 Difference Difference Mean Standard Deviation 6.33 7.20 ARG/PDW: MCEN4027F00 IV: 12 When each value in one sample has a clear counterpart in the second sample or is related to a specific value in the second sample, we can utilize an approach to determine whether there is a difference between the paired values that is more sensitive than those previously described. If the differences (like the values) are close to being normally distributed, then we can calculate the mean and standard deviation of the differences and apply a t-test. Our assumption is that if there is no real overall difference, then the average of the differences should be zero. Compare the population means. Use the t-test with: Ho: difference = d = 0; H1: difference 0 Calculate test statistic: t d s n 6.33 2.15 7.20 6 Critical value of the t-statistic at = 0.05 with df = n–1 = 5: Upper limit: t1-/2 = t0.975 = 2.571 Lower limit: t/2 = t0.025 = -2.571 Decision: Since the test statistic does not exceed the limit, we accept the null hypothesis and conclude that there is no difference in hardness due to the heat treatment. ARG/PDW: MCEN4027F00 IV: 13 EXCEL Statistical Package t-Test: Paired Two Sample for Means Mean Variance Observations Pearson Correlation Hypothesized Mean Difference df t Stat P(T<=t) one-tail t Critical one-tail P(T<=t) two-tail t Critical two-tail Variable 1 80.66666667 15.86666667 6 -0.35153783 0 5 2.154089791 0.041905297 2.015049176 0.083810593 2.570577635 Variable 2 74.33333333 22.66666667 6