Confidence Intervals for \(\mu_1 - \mu_2\), Welch’s t test, Inferences about \(\mu_1-\mu_2\) for Paired Data
In many situations one wishes to compare the means of two different populations.
Let \(\mu_1\) and \(\mu_2\) denote means two populations.
Most often, the comparison of interest is the difference \(\mu_1 - \mu_2\).
We will make the comparison based on a random sample from each population. Suppose samples of sizes \(n_1\) and \(n_2\) are drawn.
Let \(\bar{Y}_1\) and \(\bar{Y}_2\) denote sample mean random variables and \(S_1\) and \(S_2\) be the sample standard deviation random variables computed from each sample.
Also assume that the samples are drawn independently from each population, and that the populations have the same variance \(\sigma^2\).
For large sample sizes, the random variables \(\bar{Y}_1\) and \(\bar{Y}_2\) are approximately normal.
Thus the random variable \(\bar{Y}_1 - \bar{Y}_2\) is also approximately normal.
The mean of the random variable \(\bar{Y}_1 - \bar{Y}_2\) is \(\mu_1 - \mu_2\) and standard deviation is \[\sigma_{\bar{Y}_1 - \bar{Y}_2} = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}\] where \(\sigma_1^2\) and \(\sigma_2^2\) are the variances of each of each population.
However, under the assumption that \(\sigma_1^2 = \sigma_2^2 \equiv \sigma^2\), the standard deviation becomes \[\sigma_{\bar{Y}_1 - \bar{Y}_2} = \sqrt{\frac{\sigma^2}{n_1} + \frac{\sigma^2}{n_2}} =\sigma\sqrt{\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}\]
An estimator of \(\sigma_{\bar{Y}_1 - \bar{Y}_2}\) is \[S_{\bar{Y}_1 - \bar{Y}_2} = S_p \sqrt{\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}\]
\(S_p^2\) is the pooled estimator of the common variance \(\sigma^2\) of the two populations.
This is obtained under the assumption that \(\sigma_1^2 = \sigma_2^2 \equiv \sigma^2\), the common variance.
Consider the random variable defined as: \[T_{n_1 + n_2 - 2} = \frac{(\bar{Y}_1 - \bar{Y}_2) - (\mu_1 - \mu_2)}{S_{\bar{Y}_1 - \bar{Y}_2}}\]
When sampling is from Normal distributions, the distribution of the above statistic is distributed exactly as Student’s \(t\) with \(df=n_1 + n_2 - 2\).
For large samples we may use the CLT and say that \(T_{n_1 + n_2 -2}\) will be approximately distributed as Student’s \(t\) with \(df=n_1 + n_2 - 2\)
For small samples, however, we must verify if the samples were actually drawn from Normal distributions, using tools such as boxplots and normal probability plots
We shall do that before calculating confidence intervals for \(\mu_1 - \mu_2\), and for testing hypotheses using the \(t\) distribution.
The pooled estimator of the common variance \(\sigma^2\), \(S_p^2\), is obtained using the weighted average \[S_p^2 = \frac{(n_1-1)S_1^2 + (n_2-1)S_2^2}{n_1+n_2 - 2}\]
Here \(S_1^2\) and \(S_2^2\) are sample variance random variables. \(S_1^2 = \frac{1}{n_1-1} \sum_{j=1}^{n_1} (Y_{1j} - \bar{Y}_1)^2\) \(S_2^2 = \frac{1}{n_2-1} \sum_{j=1}^{n_1} (Y_{2j} - \bar{Y}_2)^2\)
Thus a 100(1-\(\alpha\))% Confidence Interval for \(\mu_1 - \mu_2\) is \(\bar{y}_1 - \bar{y}_2 \pm t_{\alpha/2,df}\cdot \, s_p\) \(\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}\)
Here \(df= n_1 + n_2 - 2\) and \[s_p = \sqrt{\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1 + n_2 - 2}}\]
Company officials, concerned about potency of a product retained after storage, drew a random sample of \(n_1=10\) bottles from the production line and tested for potency. Another random sample of \(n_2=10\) bottles was drawn and stored in a regulated environment for 1 year and then tested. The data obtained are:
| Fresh | Stored | |||
|---|---|---|---|---|
| 10.2 | 10.6 | 9.8 | 9.7 | |
| 10.5 | 10.7 | 9.6 | 9.5 | |
| 10.3 | 10.2 | 10.1 | 9.6 | |
| 10.8 | 10.0 | 10.2 | 9.8 | |
| 9.8 | 10.6 | 10.1 | 9.9 | |
\(n_1 = n_2 = 10\)
\(\bar{y}_1 =103.7/10= 10.37 \quad \quad \bar{y}_2 =98.3/10= 9.83\)
\(s_1^2 = [1076.31-\frac{(103.7)^2}{10}]/9=0.105\)
\(s_2^2 =[966.81-\frac{(98.3)^2}{10}]/9= .058\)
\[\begin{eqnarray*} s_p & = & \sqrt{\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1 + n_2 - 2}}=\sqrt{\frac{9}{18} (s_1^2 + s_2^2)}\\[.15in] & = & \sqrt{\frac{.105+.058}{2}} = 0.285 \end{eqnarray*}\]
The t-percentile based on \(df= n_1+n_2-2= 10+ 10 -2= 18\) and \(\alpha=.025\) is \(t_{.025,18}=2.101\)
Thus a 95% confidence interval for the difference in the mean potencies \(\mu_1-\mu_2\) is:
\((10.37-9.83) \pm2.102 (.285)\sqrt{\frac{1}{10}+\frac{1}{10}}\)
\(.54\pm .268\) or \((.272,\,.808)\)
Thus, the difference in mean potencies for bottles from the production line and those stored for one year, \(\mu_1-\mu_2\), is estimated to be between .272 and .808 with 95% confidence.
The types of hypothesis that may be tested are similar to those on the mean of a single population. These are:
(where \(D_0\) is a specified number, often zero.)
The test statistic for testing each of the above hypotheses is \[T = \frac{\bar{Y}_1 - \bar{Y}_2 - D_0}{S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}\]
The two-sample t-statistic is calculated using the sample statistics: \(\bar{y}_1, \bar{y}_2\) and \(s_p\):
\[t =\frac{\bar{y}_1 - \bar{y}_2 - D_0}{s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}\]
The rejection regions for each test, respectively, are:
Reject \(H_0\) if \(t > t_{\alpha,\,df}\)
Reject \(H_0\) if \(t < -t_{\alpha,\,df}\)
Reject \(H_0\) if \(|t| > t_{\alpha/2,\,df}\)
Note that the degrees of freedom is \(df=n_1+n_2-2\)
Two different emission-control devices were being tested to determine the average amount of nitric oxide being emitted by an automobile over a 1-hour period of time. Twenty cars of the same model and year were selected for the study. Ten cars were randomly selected and equipped with a Type 1 emission-control device, and the remaining cars were equipped with Type II devices. Each of the 20 cars was then monitored for a 1-hour period to determine the amount of nitric oxide emitted.
Use the following data to test the research hypothesis that the mean level of emission for Type 1 devices (\(\mu_1\)) is greater than the mean emission level for Type II devices (\(\mu_2\)). Use \(\alpha=.01\).
| Type 1 Device | Type II Device | |||
|---|---|---|---|---|
| 1.35 | 1.28 | 1.01 | 0.96 | |
| 1.16 | 1.21 | 0.98 | 0.99 | |
| 1.23 | 1.25 | 0.95 | 0.98 | |
| 1.20 | 1.17 | 1.02 | 1.01 | |
| 1.32 | 1.19 | 1.05 | 1.02 | |
\(n_1 = n_2 = 10\)
\(\ \bar{y}_1 = 1.236 \quad \quad \bar{y}_2 = 0.997\)
\(s_1^2 = 0.004096 \quad s_2^2 = 0.0009\)
\(s_p^2 = \frac{9}{18} (s_1^2 + s_2^2) = 0.0025 \quad \quad s_p\) = 0.05
\(H_0: \mu_1 - \mu_2 \leq 0\) vs. \(H_a: \mu_1 - \mu_2 > 0\)
\(t_c = \frac{1.236-0.997}{0.05\sqrt{0.2}} = 10.71\)
\(t_{0.01,18} = 2.552\) implying R.R. is \(t>2.552\)
Therefore reject \(H_0\) at \(\alpha=.01\) as \(t_c\) is in the R.R. Thus it appears that the mean level of emission for the Type I device is greater than for Type II.
The two samples are drawn independently from the two populations.
The two populations are such that \(\bar{Y}_1\) and \(\bar{Y}_2\) are approximately normal. (We make use of the CLT if the size of samples \(n_1\) and \(n_2\) are sufficiently large.)
The two populations have the same variance \(\sigma^2\) (in order to see if this assumption may not hold one looks at \(s_1^2\) and \(s_2^2\).)
Assumption 3 is the unusual. When \(n_1 = n_2 = n\), unless studies indicate that \(\sigma_1^2\) and \(\sigma_2^2\) can differ by as much as a factor of 3, it won’t make a difference in the inference about \(\mu_1 - \mu_2\) based on the use of given formulae for C.I.’s and tests.
When we find ourselves in a situation where Assumption 3. seems to be seriously violated, we can use an an approximate \(t\) test described below.
The hypotheses to be tested are as usual:
The test statistic is : \[t' = \frac{(\bar{y}_1 - \bar{y}_2) - D_0} {\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}\] Note that the two sample variances are NOT pooled to obtain a pooled sample variance estimate.
The percentile points of the \(t'\)-statistic are approximated by using the t-table with an adjusted degrees of freedom given by: \[df = \frac{(n_1-1)(n_2-1)}{(n_2-1)c^2 + (1-c)^2(n_1-1)}\]
(round down to an integer)
where \[c = \frac{s_1^2/n_1}{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}\]
For specified \(\alpha\) the rejection regions for the three hypotheses, respectively, are given by:
An approximate \(100(1-\alpha)\%\) confidence interval for \(\mu_1 - \mu_2\) is: \[(\bar{y}_1 - \bar{y}_2) \pm t_{\alpha/2,\,df}\cdot \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}\] where \(t_{\alpha/2}\) is the \(t\) quantile found from the t-table for \(df\) computed using the above formula.
STAT 801A