STAT 3360 Notes
1 Two-Population Inference: Difference btwn Means
1.1 Matched Pairs
1.1.1 Introduction
- In some cases, we have two samples of the same size such that one observation in the first sample is related exactly to another observation in the second sample.
- For example, for the same group of \(n\) students, we have their test scores for Exam 1 and Exam 2. If we use \(X\) to represent the test score of Exam 1 and \(Y\) for Exam 2, then the whole data can be represented as \((X_1, Y_1), (X_2, Y_2), \dots, (X_n, Y_n)\), where \(X_i\) and \(Y_i\) represent the Exam 1 and Exam 2 scores for the \(i\)-th student, respectively. Note \(X_i\) is paired with \(Y_i\) only. We are interested in comparing the scores of Exam 1 and Exam 2 for the same student, and are not interested in comparing the Exam 1 score of Tom with Exam 2 score of Jerry.
- Calculating the differences for all pairs, we get a single sample of differences, so the inference approaches for one-population problems (confidence intervals and hypothesis tests for the population mean/variance of the differences) can be immediately implemented. For example, \(X_1 - Y_1, X_2 - Y_2, \dots, X_n - Y_n\) constitute a single sample about the difference between the two exam scores for each student, and we can construct confidence interval and perform hypothesis tests for the difference.
1.1.2 Assumptions and Notations
- \((X, Y)\): the pair of random variables representing the first and the second observations of the same object;
- \(D = X - Y\): the random variable representing the difference between the two observations of the same object;
- \(\mu_D\): the unknown population mean of \(D\);
- \(\sigma_D\): the population standard deviation of \(D\), which is usually unknown.
- \(n\): the number of objects for each of which two observations are made;
- \(X_i, i = 1,2,\dots, n\): the first observation of the \(i\)-th object;
- \(Y_i, i = 1,2,\dots, n\): the second observation of the \(i\)-th object;
- \(D_i\): \(X_i - Y_i\), the difference between the two observations of the \(i\)-th object;
- \(\bar{X}\): the sample mean of \(X\), which is \(\frac{1}{n}\sum\limits_{i=1}^{n}X_i\);
- \(\bar{Y}\): the sample mean of \(Y\), which is \(\frac{1}{n}\sum\limits_{i=1}^{n}Y_i\);
- \(\bar{D}\): the sample mean of \(D\), which is \(\frac{1}{n}\sum\limits_{i=1}^{n}D_i\);
- It is easily seen that \(\boxed{\bar{D}} = \frac{1}{n} \sum\limits_{i=1}^{n}D_i = \frac{1}{n} \sum\limits_{i=1}^{n} (X_i-Y_i) = \frac{1}{n} \sum\limits_{i=1}^{n}X_i - \frac{1}{n} \sum\limits_{i=1}^{n}Y_i = \boxed{\bar{X} - \bar{Y}}\).
- \(s_D\): the sample standard deviation of \(D_i\).
1.1.3 Confidence Interval
- Since the population standard deviation of the difference \(D\), denoted by \(\sigma_D\), is usually unknown, the confidence interval of \(\mu_D\) should be based on the \(t\) distribution (of course, if \(\sigma_D\) is known, then the standard Normal distribution should be used).
- According to the formula introduced in the Section "One-Population Inference: Population Mean - Population Standard Deviation Unknown", at Confidence Level \(1 - \alpha\), the confidence interval for \(\mu_D\) can be constructed as follows,
- Midpoint: \(\boxed{ \bar{D} }\), which is shown above equal to \(\boxed{ \bar{X} - \bar{Y} }\).
- Critical Value: \(\boxed{ t_{\alpha/2, n-1} }\);
- Margin of Error: \(\boxed{ t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} }\);
- Lower Confidence Limit (LCL): \(\boxed{ \bar{D} - t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} }\);
- Upper Confidence Limit (UCL): \(\boxed{ \bar{D} + t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} }\);
- Confidence Interval: \(\boxed{ \left[ \bar{D} - t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}}, \bar{D} + t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} \right] }\);
- Width of Confidence Interval: \(\boxed{ 2 \cdot t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} }\);
1.1.4 Hypothesis Testing
- Since the population standard deviation of the difference \(D\), denoted by \(\sigma_D\), is usually unknown, the hypothesis testing of \(\mu_D\) should be based on the \(t\) distribution (of course, if \(\sigma_D\) is known, then the standard Normal distribution should be used).
- According to the formula introduced in the Section "One-Population Inference: Population Mean - Population Standard Deviation Unknown", at Significance Level \(\alpha\),
- the t-test for \(\boxed{H_0: \mu_D \le d_0 \text{ vs } H_A: \mu_D > d_0}\) (which is equivalent to \(\boxed{H_0: \mu_D = d_0 \text{ vs } H_A: \mu_D > d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\sqrt{n}(\bar{D} - d_0)}{s_D}}\);
- Critical Value: \(\boxed{t_{\alpha, n-1}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T > t_{\alpha, n-1}}\).
- the t-test for \(\boxed{H_0: \mu_D \ge d_0 \text{ vs } H_A: \mu_D < d_0}\) (which is equivalent to \(\boxed{H_0: \mu_D = d_0 \text{ vs } H_A: \mu_D < d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\sqrt{n}(\bar{D} - d_0)}{s_D}}\);
- Critical Value: \(t_{1-\alpha, n-1}\), which equals \(\boxed{- t_{\alpha, n-1}}\)
- Rejection Rule: Reject \(H_0\) if \(T < t_{1-\alpha, n-1}\), which is equivalent to \(\boxed{T < - t_{\alpha, n-1}}\)
- the t-test for \(\boxed{H_0: \mu_D = d_0 \text{ vs } H_A: \mu_D \neq d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\sqrt{n}(\bar{D} - d_0)}{s_D}}\);
- Critical Values: \(t_{1-\alpha/2, n-1}\) (which equals \(\boxed{- t_{\alpha/2, n-1}}\)) and \(\boxed{t_{\alpha/2, n-1}}\);
- Rejection Rule: Reject \(H_0\) if \(T > t_{\alpha/2, n-1}\) or \(T < - t_{\alpha/2, n-1}\), which is equivalent to \(\boxed{|T| > t_{\alpha/2, n-1}}\).
- As shown above, \(\boxed{ \bar{D} = \bar{X} - \bar{Y} }\).
1.1.5 Example
- A teacher would like to know whether his students have made any progress from Exam 1 to Exam 2. Suppose \(16\) students are sampled, and their average scores for Exam 1 and Exam 2 are \(79\) and \(80\), respectively. Also, for the \(i\)-th student, the paired difference \(D_i = \text{(Exam 1 score - Exam 2 score)}\) is calculated, and the sample standard deviation of all the \(D_i\) 's is \(2\).
- Q1: (Confidence Interval) What is the confidence interval for the difference between Exam 1 score and Exam 2 score of a student, at confidence level of \(90\%\)?
- Let
- \((X, Y)\) be the pair of the two exam scores of the same student, with \(X\) for Exam 1 and \(Y\) for Exam 2;
- \(D = X - Y\) be the random variable representing the difference between the two exam scores of the same student;
- \(\mu_D\) be the population mean of \(D\), which is unknown;
- \(\sigma_D\) be the population standard deviation of \(D\), which is unknown.
- Then we know
- the sample size (number of pairs) is \(n = 16\);
- the sample mean of \(D\) is \(\bar{D} = \bar{X} - \bar{Y} = 79 - 80 = -1\);
- the sample standard deviation of \(D\) is \(s_D = 2\).
- We want a \(90\%\) confidence interval of \(\mu_D\).
- Since \(\sigma_D\), the population standard deviation of \(D\) is unknown, we should use critical values based on \(t\) distribution.
- To construct the confidence interval for \(\mu_D\),
- the confidence level is \(1 - \alpha = 90\%\), so \(\alpha = 0.1\);
- the midpoint of the confidence interval is \(\bar{D} = -1\);
- the critical value is \(t_{\alpha/2, n-1} = t_{0.1/2, 16-1} = t_{0.05, 15} = 1.753\);
- the margin of error is \(t_{\alpha/2, n-1} \cdot \frac{s_D}{\sqrt{n}} = 1.753 \cdot \frac{2}{\sqrt{16}} = 0.8765\);
- the lower confidence limit is \(-1 - 0.8765 = -1.8765\);
- the upper confidence limit is \(-1 + 0.8765 = -0.1235\);
- the confidence interval is \([-1.8765, -0.1235]\);
- the width of the confidence interval is \(2 \times 0.8765 = 1.753\).
- Q2: (Hypothesis Testing) At \(5\%\) significance level, do we have sufficient evidence that the students have different performance between Exam 1 and Exam 2?
- Here we want to confirm the claim that \(\mu_D \neq 0\), so we let it be the alternative hypothesis. That is, we want to test \(H_0: \mu_D = 0\) vs \(H_A: \mu_D \neq 0\);
- The test statistic is \(T = \frac{\sqrt{n}(\bar{D} - d_0)}{s_D} = \frac{\sqrt{16}(-1 - 0)}{2} = -2\);
- The significance level is \(\alpha = 5\%\);
- The critical values are \(- t_{\alpha/2, n-1} = -t_{0.025, 15} = -2.131\) and \(t_{\alpha/2, n-1} = t_{0.025, 15} = 2.131\);
- The rejection rule is: reject \(H_0\) if \(|T| > t_{\alpha/2, n-1}\);
- Here \(|T| = 2 < 2.131 = t_{\alpha/2, n-1}\), so we don't have enough evidence to reject \(H_0\) and thus don't have enough evidence to say that the students have different performance between Exam 1 and Exam 2.
- Q3: (Hypothesis Testing) At \(5\%\) significance level, do we have sufficient evidence that the students perform better in Exam 2 than in Exam 1?
- Here we want to confirm the claim that \(\mu_D < 0\), so we let it be the alternative hypothesis. That is, we want to test \(H_0: \mu_D \ge 0\) vs \(H_A: \mu_D < 0\) (or equivalently \(H_0: \mu_D = 0\) vs \(H_A: \mu_D < 0\));
- The test statistic is \(T = \frac{\sqrt{n}(\bar{D} - d_0)}{s_D} = \frac{\sqrt{16}(-1 - 0)}{2} = -2\);
- The significance level is \(\alpha = 5\%\);
- The critical value is \(- t_{\alpha, n-1} = - t_{0.05, 16-1} = - 1.753\);
- The rejection rule is: reject \(H_0\) if \(T < - t_{\alpha, n-1}\);
- Here \(T = -2 < -1.753 = -t_{\alpha, n-1}\), so we do have enough evidence to reject \(H_0\) and thus have enough evidence to say that the students perform better in Exam 2 than in Exam 1.
- Remark
- In Q2 we don't have enough evidence to say that the students have different performance between Exam 1 and Exam 2, which means we tend to believe the performance of the students are the same between Exam 1 and Exam 2.
- In Q3 we have enough evidence to say that the students perform better in Exam 2 than in Exam 1, which implies that the performance of the students are different between Exam 1 and Exam 2.
- In Q2 and Q3, we use the same data and the same significance level, but reached different conclusions. Does this mean any contradiction?
- No. In Q2 and Q3, we consider different questions. In Q2, we consider "different performance", which includes both "better performance" and "worse performance", while in Q3 we consider just "better performance". Since Q2 considers multiple scenarios, it has more chance for making a mistake (Type I error). Therefore, to maintain the same overall significance level (probability of Type I error) as Q3, Q2 should be more conservative (ie, need more and stronger evidence for rejecting the null hypothesis) in each individual scenario. This is the reason why Q2 doesn't reject the correpsonding \(H_0\) when Q3 does so.
1.2 Indep. Populations with Equal Pop. Var
1.2.1 Introduction
- In some cases, we want to compare two independent populations. For example, we may be interested in whether students in two different sections have the same performance. In this case, we may randomly select \(10\) students from the first section and \(20\) students from the second section, and then carry out a hypothesis test in some way to decide whether there is enough evidence that students in the two sections have different performance. This is a real two-population problem (instead of matched pairs), so we need new test procedures which are different from those for the one-population problems.
- In the current section, we will discuss the difference between the population means of two independent populations, when their population variances are EQUAL.
1.2.2 Assumptions and Notations
- \(X\): the random variable representing the characteristic of the first population;
- \(Y\): the random variable representing the characteristic of the second population;
- \(\mu_X\): the population mean of \(X\);
- \(\mu_Y\): the population mean of \(Y\);
- \(\sigma_X^2\): the population variance of \(X\);
- \(\sigma_Y^2\): the population variance of \(Y\);
- The two populations are assumed to be independent. That is, the value of \(X\) doesn't depend on the value of \(Y\) in any way;
- The two population variances are EQUAL. That is, \(\sigma_X^2 = \sigma_Y^2\).
- \(n_X\): the sample size for \(X\);
- \(n_Y\): the sample size for \(Y\);
- \(X_i, i = 1,2,\dots, n_X\): the sample for \(X\);
- \(Y_i, i = 1,2,\dots, n_Y\): the sample for \(Y\);
- \(\bar{X}\): the sample mean of \(X\);
- \(\bar{Y}\): the sample mean of \(Y\);
- \(s_X^2\): the sample variance of \(X\);
- \(s_Y^2\): the sample variance of \(Y\);
- \(s_p^2\): the pooled sample variance of the two samples, which is
\[ \boxed{ s_p^2 = \frac{(n_X - 1)s_X^2 + (n_Y - 1)s_Y^2}{n_X + n_Y - 2} } \]
- \(\boxed{ \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right) } }\): the standard error of \(\bar{X} - \bar{Y}\).
- \(\boxed{ n_X + n_Y - 2 }\): the degrees of freedom for the \(t\) distribution.
1.2.3 Confidence Interval
- When \(\sigma_X^2 = \sigma_Y^2\), at Confidence Level \(1 - \alpha\), the confidence interval for \(\mu_X - \mu_Y\) can be constructed as follows,
- Midpoint: \(\boxed{ \bar{X} - \bar{Y} }\);
- Critical Value: \(\boxed{ t_{\alpha/2, n_X + n_Y - 2} }\);
- Margin of Error: \(\boxed{ t_{\alpha/2, n_X + n_Y - 2} \cdot \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)} }\);
- Margin of Error = (Critical Value) \(\times\) (Standard Error of \(\bar{X} - \bar{Y}\))
- Lower Confidence Limit (LCL): \(\boxed{ (\bar{X} - \bar{Y}) - t_{\alpha/2, n_X + n_Y - 2} \cdot \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)} }\);
- Upper Confidence Limit (UCL): \(\boxed{ (\bar{X} - \bar{Y}) + t_{\alpha/2, n_X + n_Y - 2} \cdot \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)} }\);
- Width of Confidence Interval: \(\boxed{ 2 \cdot t_{\alpha/2, n_X + n_Y - 2} \cdot \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)} }\);
1.2.4 Hypothesis Testing
- When \(\sigma_X^2 = \sigma_Y^2\), at Significance Level \(\alpha\),
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y \le d_0 \text{ vs } H_A: \mu_X - \mu_Y > d_0}\) (which is equivalent to \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y > d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{s_p^2 (\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Value: \(\boxed{t_{\alpha, n_X + n_Y - 2}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T > t_{\alpha, n_X + n_Y - 2}}\).
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y \ge d_0 \text{ vs } H_A: \mu_X - \mu_Y < d_0}\) (which is equivalent to \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y < d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{s_p^2 (\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Value: \(t_{1-\alpha, n_X + n_Y - 2}\), which equals \(\boxed{- t_{\alpha, n_X + n_Y - 2}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T < - t_{\alpha, n_X + n_Y - 2}}\).
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y \neq d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{s_p^2 (\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Values: \(t_{1-\alpha/2, n_X + n_Y - 1}\) (which equals \(\boxed{- t_{\alpha/2, n_X + n_Y - 2}}\)) and \(\boxed{t_{\alpha/2, n_X + n_Y - 2}}\);
- Rejection Rule: Reject \(H_0\) if \(T > t_{\alpha/2, n_X + n_Y - 2}\) or \(T < - t_{\alpha/2, n_X + n_Y - 2}\), which is equivalent to \(\boxed{|T| > t_{\alpha/2, n_X + n_Y - 2}}\).
1.2.5 Example
- A teacher would like to compare the performance of his students in two different sections. Suppose \(10\) students from Section 1 and \(15\) students from Section 2 are sampled, and their final exam scores are obtained. Suppose the sample mean and sample standard deviation of the scores in Section 1 are \(79\) and \(4\) respectively, and the sample mean and sample standard deviation of the scores in Section 2 are \(80\) and \(5\) respectively. Assume that the population variances of the scores in the two sections are the same.
- Q1: (Confidence Interval) What is the confidence interval for the difference between the two sections' final exam scores, at confidence level of \(90\%\)?
- Let
- \(X\) be the final exam score of a student from Section 1;
- \(Y\) be the final exam score of a student from Section 2;
- \(\mu_X\) be the population mean of \(X\);
- \(\mu_Y\) be the population mean of \(Y\);
- \(\sigma_X^2\) be the population variance of \(X\);
- \(\sigma_Y^2\) be the population variance of \(Y\);
- Then we know
- \(\sigma_X^2 = \sigma_Y^2\);
- the sample size for \(X\) is \(n_X = 10\);
- the sample size for \(Y\) is \(n_Y = 15\);
- the sample mean of \(X\) is \(\bar{X} = 79\);
- the sample mean of \(Y\) is \(\bar{Y} = 80\);
- the sample variance of \(X\) is \(s_X^2 = 4^2 = 16\);
- the sample variance of \(Y\) is \(s_Y^2 = 5^2 = 25\);
- the pooled sample variance is \(s_p^2 = \frac{(n_X - 1)s_X^2 + (n_Y - 1)s_Y^2}{n_X + n_Y - 2} = \frac{(10 - 1)16 + (15 - 1)25}{10 + 15 - 2} = 21.5\)
- the standard error of \(\bar{X} - \bar{Y}\) is \(\sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right) } = \sqrt{21.5 \left( \frac{1}{10} + \frac{1}{15} \right) } = 1.893\)
- We want a \(90\%\) confidence interval of \(\mu_X - \mu_Y\).
- To construct the confidence interval for \(\mu_X - \mu_Y\),
- the confidence level is \(1 - \alpha = 90\%\), so \(\alpha = 0.1\);
- the midpoint of the confidence interval is \(\bar{X} - \bar{Y} = 79 - 80 = -1\);
- the critical value is \(t_{\alpha/2, n_X + n_Y - 2} = t_{0.1/2, 10 + 15 - 2} = t_{0.05, 23} = 1.714\);
- the margin of error is \(t_{\alpha/2, n_X + n_Y - 2} \cdot \sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)} = 1.714 \cdot 1.893 = 3.245\);
- the lower confidence limit is \(-1 - 3.245 = -4.245\);
- the upper confidence limit is \(-1 + 3.245 = 2.245\);
- the confidence interval for \(\mu_X - \mu_Y\) is \([-4.245, 2.245]\);
- the width of the confidence interval is \(2 \times 3.245 = 6.49\).
- Q2: (Hypothesis Testing) At \(5\%\) significance level, do we have sufficient evidence that the students from Section 2 perform better than students from Section 1 in the final exam?
- Here we want to confirm the claim that \(\mu_X - \mu_Y < 0\), so we let it be the alternative hypothesis. That is, we want to test \(H_0: \mu_X - \mu_Y \ge 0\) vs \(H_A: \mu_X - \mu_Y < 0\) (or equivalently \(H_0: \mu_X - \mu_Y = 0\) vs \(H_A: \mu_X - \mu_Y < 0\));
- The test statistic is \(T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{s_p^2 \left( \frac{1}{n_X} + \frac{1}{n_Y} \right)}} = \frac{(79 - 80 - 0)}{\sqrt{21.5 \left( \frac{1}{10} + \frac{1}{15} \right)}} = -0.528\);
- The significance level is \(\alpha = 5\%\);
- The critical value is \(- t_{\alpha, n_X + n_Y - 2} = - t_{0.05, 10 + 15 - 2} = - 1.714\);
- The rejection rule is: reject \(H_0\) if \(T < - t_{\alpha, n_X + n_Y - 2}\);
- Here \(T = -0.528 > -1.714 = -t_{\alpha, n_X + n_Y - 2}\), so we don't have enough evidence to reject \(H_0\) and thus don't have enough evidence to say that the students from Section 2 perform better than students from Section 1 in the final exam.
1.3 Indep. Populations with Unequal Pop. Var
1.3.1 Introduction
- In the previous section, we discussed the difference between the population means of two independent populations, when their population variances are equal.
- In this section, we will discuss the difference between the population means of two independent populations, when their population variances are UNEQUAL.
- For simplicity, when we don't know whether two population variances are equal or not, regard them as unequal.
1.3.2 Assumptions and Notations
- \(X\): the random variable representing the characteristic of the first population;
- \(Y\): the random variable representing the characteristic of the second population;
- \(\mu_X\): the population mean of \(X\);
- \(\mu_Y\): the population mean of \(Y\);
- \(\sigma_X^2\): the population variance of \(X\);
- \(\sigma_Y^2\): the population variance of \(Y\);
- The two populations are assumed to be independent. That is, the value of \(X\) doesn't depend on the value of \(Y\) in any way;
- The two population variances are UNEQUAL. That is, \(\sigma_X^2 \neq \sigma_Y^2\).
- \(n_X\): the sample size for \(X\);
- \(n_Y\): the sample size for \(Y\);
- \(X_i, i = 1,2,\dots, n_X\): the sample for \(X\);
- \(Y_i, i = 1,2,\dots, n_Y\): the sample for \(Y\);
- \(\bar{X}\): the sample mean of \(X\);
- \(\bar{Y}\): the sample mean of \(Y\);
- \(s_X^2\): the sample variance of \(X\);
- \(s_Y^2\): the sample variance of \(Y\);
- \(\boxed{ \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } }\): the standard error of \(\bar{X} - \bar{Y}\);
- \(\boxed{ \nu = \frac{(s_X^2/n_X + s_Y^2/n_Y)^2}{\frac{(s_X^2/n_X)^2}{n_X - 1} + \frac{(s_Y^2/n_Y)^2}{n_Y - 1} } }\): the degrees of freedom for the approximate \(t\) distribution.
1.3.3 Confidence Interval
- When \(\sigma_X^2 \neq \sigma_Y^2\), at Confidence Level \(1 - \alpha\), the confidence interval for \(\mu_X - \mu_Y\) can be constructed as follows,
- Midpoint: \(\boxed{ \bar{X} - \bar{Y} }\);
- Critical Value: \(\boxed{ t_{\alpha/2, \nu} }\);
- Margin of Error: \(\boxed{ t_{\alpha/2, \nu} \cdot \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } }\);
- Margin of Error = (Critical Value) \(\times\) (Standard Error of \(\bar{X} - \bar{Y}\))
- Lower Confidence Limit (LCL): \(\boxed{ (\bar{X} - \bar{Y}) - t_{\alpha/2, \nu} \cdot \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } }\);
- Upper Confidence Limit (UCL): \(\boxed{ (\bar{X} - \bar{Y}) + t_{\alpha/2, \nu} \cdot \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } }\);
- Width of Confidence Interval: \(\boxed{ 2 \cdot t_{\alpha/2, \nu} \cdot \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } }\);
1.3.4 Hypothesis Testing
- When \(\sigma_X^2 \neq \sigma_Y^2\), at Significance Level \(\alpha\),
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y \le d_0 \text{ vs } H_A: \mu_X - \mu_Y > d_0}\) (which is equivalent to \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y > d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} }}}\);
- Critical Value: \(\boxed{t_{\alpha, \nu}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T > t_{\alpha, \nu}}\).
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y \ge d_0 \text{ vs } H_A: \mu_X - \mu_Y < d_0}\) (which is equivalent to \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y < d_0}\)) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} }}}\);
- Critical Value: \(t_{1-\alpha, \nu}\), which equals \(\boxed{- t_{\alpha, \nu}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T < - t_{\alpha, \nu}}\).
- the t-test for \(\boxed{H_0: \mu_X - \mu_Y = d_0 \text{ vs } H_A: \mu_X - \mu_Y \neq d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} }}}\);
- Critical Values: \(t_{1-\alpha/2, \nu}\) (which equals \(\boxed{- t_{\alpha/2, \nu}}\)) and \(\boxed{t_{\alpha/2, \nu}}\);
- Rejection Rule: Reject \(H_0\) if \(T > t_{\alpha/2, \nu}\) or \(T < - t_{\alpha/2, \nu}\), which is equivalent to \(\boxed{|T| > t_{\alpha/2, \nu}}\).
1.3.5 Example
- A teacher would like to compare the performance of his students in two different sections. Suppose \(10\) students from Section 1 and \(15\) students from Section 2 are sampled, and their final exam scores are obtained. Suppose the sample mean and sample standard deviation of the scores in Section 1 are \(79\) and \(4\) respectively, and the sample mean and sample standard deviation of the scores in Section 2 are \(80\) and \(5\) respectively. Assume that the population variances of the two sections are UNEQUAL.
- Q1: (Confidence Interval) What is the confidence interval for the difference between the two sections' final exam scores, at confidence level of \(90\%\)?
- Let
- \(X\) be the final exam score of a student from Section 1;
- \(Y\) be the final exam score of a student from Section 2;
- \(\mu_X\) be the population mean of \(X\);
- \(\mu_Y\) be the population mean of \(Y\);
- \(\sigma_X^2\) be the population variance of \(X\);
- \(\sigma_Y^2\) be the population variance of \(Y\);
- Then we know
- \(\sigma_X^2 = \sigma_Y^2\);
- the sample size for \(X\) is \(n_X = 10\);
- the sample size for \(Y\) is \(n_Y = 15\);
- the sample mean of \(X\) is \(\bar{X} = 79\);
- the sample mean of \(Y\) is \(\bar{Y} = 80\);
- the sample variance of \(X\) is \(s_X^2 = 4^2 = 16\);
- the sample variance of \(Y\) is \(s_Y^2 = 5^2 = 25\);
- the standard error of \(\bar{X} - \bar{Y}\) is \(\sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } = \sqrt{ \frac{16}{10} + \frac{25}{15} } = 1.807\);
- the degrees of freedom for the approximate \(t\) distribution is \(\nu = \frac{(s_X^2/n_X + s_Y^2/n_Y)^2}{\frac{(s_X^2/n_X)^2}{n_X - 1} + \frac{(s_Y^2/n_Y)^2}{n_Y - 1}} = \frac{(16/10 + 25/15)^2}{\frac{(16/10)^2}{10 - 1} + \frac{(25/15)^2}{15 - 1}} = 22.1 \approx 22\)
- We want a \(90\%\) confidence interval of \(\mu_X - \mu_Y\).
- To construct the confidence interval for \(\mu_X - \mu_Y\),
- the confidence level is \(1 - \alpha = 90\%\), so \(\alpha = 0.1\);
- the midpoint of the confidence interval is \(\bar{X} - \bar{Y} = 79 - 80 = -1\);
- the critical value is \(t_{\alpha/2, \nu} = t_{0.1/2, 22} = t_{0.05, 22} = 1.717\);
- the margin of error is \(t_{\alpha/2, \nu} \cdot \sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} } = 1.717 \cdot 1.807 = 3.103\);
- the lower confidence limit is \(-1 - 3.103 = -4.103\);
- the upper confidence limit is \(-1 + 3.103 = 2.103\);
- the confidence interval for \(\mu_X - \mu_Y\) is \([-4.103, 2.103]\);
- the width of the confidence interval is \(2 \times 3.103 = 6.206\).
- Q2: (Hypothesis Testing) At \(5\%\) significance level, do we have sufficient evidence that the students from Section 2 perform better than students from Section 1 in the final exam?
- Here we want to confirm the claim that \(\mu_X - \mu_Y < 0\), so we let it be the alternative hypothesis. That is, we want to test \(H_0: \mu_X - \mu_Y \ge 0\) vs \(H_A: \mu_X - \mu_Y < 0\) (or equivalently \(H_0: \mu_X - \mu_Y = 0\) vs \(H_A: \mu_X - \mu_Y < 0\));
- The test statistic is \(T = \frac{(\bar{X} - \bar{Y} - d_0)}{\sqrt{ \frac{s_X^2}{n_X} + \frac{s_Y^2}{n_Y} }} = \frac{(79 - 80 - 0)}{\sqrt{ \frac{16}{10} + \frac{25}{15} }} = -0.553\);
- The significance level is \(\alpha = 5\%\);
- The critical value is \(- t_{\alpha, \nu} = - t_{0.05, 22} = - 1.717\);
- The rejection rule is: reject \(H_0\) if \(T < - t_{\alpha, \nu}\);
- Here \(T = -0.553 > -1.717 = -t_{\alpha, \nu}\), so we don't have enough evidence to reject \(H_0\) and thus don't have enough evidence to say that the students from Section 2 perform better than students from Section 1 in the final exam.
- Remark
- Compare this problem (in which the two population variances are assumed to be unequal) with the one in which the two population variances are assumed to be equal. We see that, based on these two different assumptions, different critical values, different test statistics and different degrees of freedom for the \(t\) distributions are used.
- It is possible that under the assumption of equal variances \(H_0\) is rejected while under assumption of unequal variances \(H_0\) is not rejected (although the above examples failed to demonstrate it).
2 Two-Population Inference: Difference btwn Prpts
2.1 Introduction
- In some cases, we want to compare two proportions. For example, we may be interested in whether the proportions of male students in two different sections are the same.
2.2 Assumptions and Notations
- \(p_X\): the population proportion of the event of interest in the first population;
- \(p_Y\): the population proportion of the event of interest in the second population;
- \(n_X\): the number of observations from the first population;
- \(n_Y\): the number of observations from the second population;
- \(N_X\): the number of occurrences of the event in the first sample;
- \(N_Y\): the number of occurrences of the event in the second sample;
- \(\hat{p}_X = \frac{N_X}{n_X}\): the sample proportion of the event in the first population;
- \(\hat{p}_Y = \frac{N_Y}{n_Y}\): the sample proportion of the event in the second population;
- \(\hat{p} = \frac{N_X + N_Y}{n_X + n_Y}\): the overall proportion of the event of interest among the combined sample.
2.3 Sampling Distribution
- \(\hat{p}_X - \hat{p}_Y\) is approximately Normally distributed with
- population mean \(\boxed{ \mu_{\hat{p}_X - \hat{p}_Y} = E(\hat{p}_X - \hat{p}_Y) = p_X - p_Y }\);
- population variance \(\boxed{ \sigma_{\hat{p}_X - \hat{p}_Y}^2 = Var(\hat{p}_X - \hat{p}_Y) = \frac{p_X(1-p_X)}{n_X} + \frac{p_Y(1-p_Y)}{n_Y} }\)
- That is
\[ \boxed{ \hat{p}_X - \hat{p}_Y \sim N \left( p_X - p_Y, \frac{p_X(1-p_X)}{n_X} + \frac{p_Y(1-p_Y)}{n_Y} \right) } \]
2.4 Confidence Interval
- At Confidence Level \(1 - \alpha\), the confidence interval for \(p_X - p_Y\) can be constructed as follows,
- Midpoint: \(\boxed{ \hat{p}_X - \hat{p}_Y }\);
- Critical Value: \(\boxed{ Z_{\alpha/2} }\);
- Margin of Error: \(\boxed{ Z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}} }\);
- Lower Confidence Limit (LCL): \(\boxed{ (\hat{p}_X - \hat{p}_Y) - Z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}} }\);
- Upper Confidence Limit (UCL): \(\boxed{ (\hat{p}_X - \hat{p}_Y) + Z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}} }\);
- Width of Confidence Interval: \(\boxed{ 2 \cdot Z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}} }\);
2.5 Hypothesis Testing
2.5.1 Testing \(H_0: p_X - p_Y = 0\)
- At Significance Level \(\alpha\),
- the Z-test for \(\boxed{H_0: p_X - p_Y = 0 \text{ vs } H_A: p_X - p_Y > 0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y}{\sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Value: \(\boxed{Z_{\alpha}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T > Z_{\alpha}}\).
- the Z-test for \(\boxed{H_0: p_X - p_Y = 0 \text{ vs } H_A: p_X - p_Y < 0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y}{\sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Value: \(Z_{1-\alpha}\), which equals \(\boxed{- Z_{\alpha}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T < -Z_{\alpha}}\).
- the Z-test for \(\boxed{H_0: p_X - p_Y = 0 \text{ vs } H_A: p_X - p_Y \neq 0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y}{\sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_X} + \frac{1}{n_Y})}}}\);
- Critical Values: \(Z_{1-\alpha/2}\) (which equals \(\boxed{- Z_{\alpha/2}}\)) and \(\boxed{Z_{\alpha/2}}\);
- Rejection Rule: Reject \(H_0\) if \(T > Z_{\alpha/2}\) or \(T < - Z_{\alpha/2}\), which is equivalent to \(\boxed{|T| > Z_{\alpha/2}}\).
2.5.2 Testing \(H_0: p_X - p_Y = d_0\) where \(d_0 \neq 0\)
- At Significance Level \(\alpha\),
- the Z-test for \(\boxed{H_0: p_X - p_Y = d_0 \text{ vs } H_A: p_X - p_Y > d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y - d_0}{\sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}}}}\);
- Critical Value: \(\boxed{Z_{\alpha}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T > Z_{\alpha}}\).
- the Z-test for \(\boxed{H_0: p_X - p_Y = d_0 \text{ vs } H_A: p_X - p_Y < d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y - d_0}{\sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}}}}\);
- Critical Value: \(Z_{1-\alpha}\), which equals \(\boxed{- Z_{\alpha}}\);
- Rejection Rule: Reject \(H_0\) if \(\boxed{T < -Z_{\alpha}}\).
- the Z-test for \(\boxed{H_0: p_X - p_Y = d_0 \text{ vs } H_A: p_X - p_Y \neq d_0}\) can be constructed as follows,
- Test Statistic: \(\boxed{T = \frac{\hat{p}_X - \hat{p}_Y - d_0}{\sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}}}}\);
- Critical Values: \(Z_{1-\alpha/2}\) (which equals \(\boxed{- Z_{\alpha/2}}\)) and \(\boxed{Z_{\alpha/2}}\);
- Rejection Rule: Reject \(H_0\) if \(T > Z_{\alpha/2}\) or \(T < - Z_{\alpha/2}\), which is equivalent to \(\boxed{|T| > Z_{\alpha/2}}\).
2.6 Example
- Suppose Section 1 of a course has \(30\) boys and \(40\) girls and Section 2 has \(40\) boys and \(60\) girls.
- Q1: (Confidence Interval) What is the confidence interval for the difference between proportions of boys in the two sections, at confidence level of \(90\%\)?
- Let
- \(p_X\) be the population proportion of boys in Section 1;
- \(p_Y\) be the population proportion of boys in Section 2;
- Then we know
- the number of boys from Section 1 is \(N_X = 30\);
- the number of boys from Section 2 is \(N_Y = 40\);
- the number of observations from Section 1 is \(n_X = 30+40 = 70\);
- the number of observations from Section 2 is \(n_X = 40+60 = 100\);
- the sample proportion of boys in Section 1 is \(\hat{p}_X = \frac{30}{70} = 0.4286\);
- the sample proportion of boys in Section 2 is \(\hat{p}_Y = \frac{40}{100} = 0.4\);
- the overall proportion of boys among the combined sample is \(\hat{p} = \frac{N_X + N_Y}{n_X + n_Y} = \frac{30+40}{70+100} = 0.4118\).
- We want a \(90\%\) confidence interval for \(p_X - p_Y\).
- To construct the confidence interval for \(p_X - p_Y\),
- the confidence level is \(1 - \alpha = 90\%\), so \(\alpha = 0.1\);
- the midpoint of the confidence interval is \(\hat{p}_X - \hat{p}_Y = 0.4286 - 0.4 = 0.0286\);
- the critical value is \(Z_{\alpha/2} = Z_{0.1/2} = Z_{0.05} = 1.64\);
- the margin of error is \(Z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}_X(1-\hat{p}_X)}{n_X} + \frac{\hat{p}_Y(1-\hat{p}_Y)}{n_Y}} = 1.64 \cdot \sqrt{\frac{0.4286(1-0.4286)}{70} + \frac{0.4(1-0.4)}{100}} = 0.0768\);
- the lower confidence limit is \(0.0286 - 0.0768 = -0.0482\);
- the upper confidence limit is \(0.0286 + 0.0768 = 0.1054\);
- the confidence interval is \([-0.0482, 0.1054]\);
- the width of the confidence interval is \(2 \times 0.0768 = 0.1536\).
- Q2: (Hypothesis Testing) At \(5\%\) significance level, do we have sufficient evidence that the proportion of boys in Section 1 is higher than that in Section 2?
- Here we want to confirm the claim that \(p_X - p_Y > 0\), so we let it be the alternative hypothesis. That is, we want to test \(H_0: p_X - p_Y = 0\) vs \(H_A: p_X - p_Y > 0\).
- The null hypothesis is in form \(H_0: p_X - p_Y = 0\), so
- The test statistic is \(T = \frac{\hat{p}_X - \hat{p}_Y}{\sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_X} + \frac{1}{n_Y})}} = \frac{0.4286 - 0.4}{\sqrt{0.4118(1-0.4118)(\frac{1}{70} + \frac{1}{100})}} = 0.3729\);
- The significance level is \(\alpha = 5\%\);
- The critical value is \(Z_{\alpha} = Z_{0.05} = 1.64\);
- The rejection rule is: reject \(H_0\) if \(T > Z_{\alpha}\);
- Here \(T = 0.3729 < 1.64 = Z_{\alpha}\), so we don't have enough evidence to reject \(H_0\) and thus don't have enough evidence to say that the proportion of boys in Section 1 is higher than that in Section 2.
3 References
- Keller, Gerald. (2015). Statistics for Management and Economics, 10th Edition. Stamford: Cengage Learning.
Yunfei Wang
2016-04-24 Sun 18:45