230 likes | 238 Views
Learn how to conduct a paired t-test to compare the means of two normal distributions, along with the equivalence of tests and confidence intervals.
E N D
Lecture 21 Paired t test Comparing the Means of Two Normal Distributions Equivalence of Tests and Confidence Intervals 1
Review • Suppose that X1,…,Xn form a random sample from a normal distribution for which the mean m is unknown, but the variance is known. Consider testing the hypotheses: or or • Let . You can similarly derive the critical regions as:
Review • Suppose that X1,…,Xn form a random sample from a normal distribution for which the mean m is unknown, but the variance is unknown. Consider testing the hypotheses: or or • Let . You can similarly derive the critical regions as:
Review p-值:衡量拒绝原假设的强度 通过计算一个概率,即p-值,来判断我们观测到的样本在 H0 成立的条件下,得到与样本相同或更极端的结果的概率。 如果p-值很小,则认为我们的样本不太可能在原假设的情况下产生的,应该拒绝原假设。 严格定义:p-值是根据我们观察到的数据,我们将 拒绝H0的最小水平。
用p-值得好处 • p-值是根据我们观察到的数据,我们将拒绝H0的最小水平。 • 如果p-值比显著性水平 小,我们拒绝原假设。 • 统计软件的标准输出。 • 不用预先指定显著性水平。 • 研究者A采用显著性水平0.01,而研究者B采用显著性水平0.05。
The Paired t Test • Matched-sample design: e.g. We want to compare 2 production methods. • Before/after: e.g. In a production experiment, each worker first uses one production method and then uses production method 2. Variation between workers is eliminated as a source of sampling error. • Paired: e.g. In a production experiment, each alloy is divided into 2 parts. Production method 1 is used on one part, and production method 2 is used on another part. Variation between alloys is eliminated as a source of sampling error.
Consider • Assuming then
Paired t Test: Example • Assume you work in the finance department. Is the new financial package faster (0.05 level)? You collect the following data entry times: UserCurrent Leader (1)New Software (2)DifferenceDi C.B. 9.98 Seconds 9.88 Seconds .10 T.F. 9.88 9.86 .02 M.H. 9.84 9.75 .09 R.K. 9.99 9.80 .19 M.O. 9.94 9.87 .07 D.S. 9.84 9.84 .00 S.S. 9.86 9.87 - .01 C.T. 10.12 9.86 .26 K.T. 9.90 9.83 .07 S.Z. 9.91 9.86 .05
Is the new financial package faster (0.05 level)? Reject a 0 =.05 A level a0=.05 t test reject H0 if 1.8331 Decision: Reject H0 The test statistic is calculated as Conclusion:The new software package is faster.
Comparing the Means of Two Normal Distributions • Suppose that X1,…,Xm form a random sample of m observations from a normal distribution for which both the mean m1 and the variance are unknown, suppose also that Y1,…,Yn form a random sample of n observations from a normal distribution for which both the mean m2 and the variance are unknown. Suppose the following hypotheses are to be tested at a specified level of significance a0:
Define The test statistic we will use is We will consider the test that rejects H0 when
Because are independent, Z and W are independent.
So when m1=m2, the statistic will have a tm+n-2 distribution. • Note that So the size of the test is • Given a significance level a0, we can choose a constant c such that
Example • A random sample of 8 specimens of ore is collected from a certain location in a copper mine, and that the amount of copper in each specimen is measures in grams. We denote these 8 amounts by X1,…,X8. Suppose that it is found that and . • Another random sample of 10 specimens or ore is collected from another part of the mine, and the amounts of copper in these specimens are denoted by Y1,…,Y10 . Suppose that it is found that and
Example • Let m1 denote the mean amount of copper in all the ore at the first location in the mine, and let m2 denote the mean amount of copper in all the ore at the second location. • We shall carry out an t test of the hypotheses
Solution: • Assume that all the observations have a normal distribution and that the variance is the same at both locations in the mine. • Then It can be found that the p-value is So the null hypothesis will be rejected for any specified level of significance a0>0.00167.
The Other One-Sided Hypotheses and Two-Sided Hypotheses • If we want to test the hypotheses The level a0t test rejects H0 when • If we want to test the hypotheses The level a0t test rejects H0 when
Confidence Intervaland Hypothesis TestExample: A Confidence Interval for the Mean of a Normal Distribution Suppose that X=(X1,…,Xn) is a random sample from a normal distribution with mean m and known variance . Based on the observed value x,we need to construct a coefficient g confidence interval for m. We have known that a level a0 test for testing the hypotheses is to reject H0 if
The coefficient g =1-a0 confidence interval for m is Example: A Confidence Interval for the Mean of a Normal Distribution
inside purple band, covers inside purple band, covers outside purple band, misses Interpretation of Confidence Intervals • Let • Consider intervals having the form 95% of all values
Example: Constructing a Test from a Confidence Interval Suppose that X=(X1,…,Xn) is a random sample from a normal distribution with mean m and variance both unknown. We have known that the coefficient g =1-a0 confidence interval for m is where a0=1-g, .
The equivalent a0=1-g level test of the hypotheses is to reject H0 if Example: Constructing a Test from a Confidence Interval