1.3.5.3. Two-Sample <i>t</i>-Test for Equal Means
| 1. Exploratory Data Analysis 1.3. EDA Techniques 1.3.5. Quantitative Techniques | |||
| Purpose: Test if two population means are equal | The two-sample t-test (Snedecor and Cochran, 1989) is used to determine if two population means are equal. A common application is to test if a new process or treatment is superior to a current process or treatment. There are several variations on this test. 1. The data may either be paired or not paired. By paired, we mean that there is a one-to-one correspondence between the values in the two samples. That is, if X1, X2, ..., Xn and Y1, Y2, ... , Yn are the two samples, then Xi corresponds to Yi. For paired samples, the difference Xi - Yi is usually calculated. For unpaired samples, the sample sizes for the two samples may or may not be equal. The formulas for paired data are somewhat simpler than the formulas for unpaired data. 2. The variances of the two samples may be assumed to be equal or unequal. Equal variances yields somewhat simpler formulas, although with computers this is no longer a significant issue. 3. In some applications, you may want to adopt a new process or treatment only if it exceeds the current treatment by some threshold. In this case, we can state the null hypothesis in the form that the difference between the two populations means is equal to some constant where the constant is the desired threshold. | ||
| Definition | The two-sample t-test for unpaired data is defined as: |
{\sqrt{{s^{2}_{1}}/N_{1} + {s^{2}_{2}}/N_{2}}} \) where *N*<sub>1</sub> and *N*<sub>2</sub> are the sample sizes, and are the sample means, and and are the sample variances. If equal variances are assumed, then the formula reduces to: where | | Significance Level: | *α*. | | Critical Region: | Reject the null hypothesis that the two means are equal if |*T*| > *t*<sub>1-*α*/2,*ν*</sub> where *t*<sub>1-*α*/2,*ν*</sub> is the [critical value](/u/0f515cae68028baa) of the [*t* distribution](/u/5a999917d43aa44d) with *ν* degrees of freedom where The above degrees of freedom are the [Welch-Satterthwaite](/u/45aa26ee87e50792#welch1947) formulation. The Welch-Satterthwaite degrees of freedom are robust for unequal sample sizes and/or unequal variances. If equal variances are assumed and the sample sizes are similar, then the following simpler formula for degrees of freedom can be used: ν = *N*<sub>1</sub> + *N*<sub>2</sub> - 2. | || Two-Sample t-Test Example | The following two-sample t-test was generated for the AUTO83B.DAT data set. The data set contains miles per gallon for U.S. cars (sample 1) and for Japanese cars (sample 2); the summary statistics for each sample are shown below. ```text SAMPLE 1: NUMBER OF OBSERVATIONS = 249 MEAN = 20.14458 STANDARD DEVIATION = 6.41470 STANDARD ERROR OF THE MEAN = 0.40652
SAMPLE 2:
NUMBER OF OBSERVATIONS = 79
MEAN = 30.48101
STANDARD DEVIATION = 6.10771
STANDARD ERROR OF THE MEAN = 0.68717
We are testing the hypothesis that the population means are equal for the two samples. We assume that the variances for the two samples are equal. text
H0: μ1 = μ2
Ha: μ1 ≠ μ2
Test statistic: T = -12.62059 Pooled standard deviation: sp = 6.34260 Degrees of freedom: ν = 326 Significance level: α = 0.05 Critical value (upper tail): t1-α/2,ν = 1.9673 Critical region: Reject H0 if |T| > 1.9673
| *Questions* | Two-sample *t*-tests can be used to answer the following questions: 1. Is process 1 equivalent to process 2? 2. Is the new process better than the current process? 3. Is the new process better than the current process by at least some pre-determined threshold amount? |
| *Related Techniques* | [Confidence Limits for the Mean](/u/ec677bcb19cf16f2) [Analysis of Variance](/u/e358b47166d48c46) |
| *Case Study* | [Ceramic strength](/u/97bf426f4364afe3) data. |
| *Software* | Two-sample *t*-tests are available in just about all general purpose statistical software programs. Both [Dataplot code](https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.dp) and [R code](https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.r) can be used to generate the analyses in this section. These scripts use the [AUTO83B.DAT](https://www.itl.nist.gov/div898/handbook/datasets/AUTO83B.DAT) data file. |