5. Test of Two Means Using JMP

advertisement
Statistics 312 – Dr. Uebersax
21 – Tests of Two Sample Means
1. Homework
9.7 A machine being used for packaging seedless golden raisins has been set so that, on
average, 15 ounces of raisins will be packaged per box. The quality-control engineer wishes to
test the machine setting and selects a sample of 30 consecutive raisin packages filled during
the production process.
(a) Is there evidence that the mean weight per box is different from 15 ounces? (Use α = 0.05.)
H0: μ = 15g
H1: μ ≠ 15g
X  15.11
s = 0.4058
s
X
t

s
= .4058/√30 = 0.0741
n
X 
s
X

15.1133  15 0.1133

 1.53
.0741
.0741
p-value (two-tailed) = area in t distribution (with 30 – 1 = 29 df) above t plus area below
–t.
= TDIST(-1.53, 29, 2) = 0.1369 > 0.05
H0 not rejected, no evidence of difference from 15g.
Statistics 312 – Dr. Uebersax
21 – Tests of Two Sample Means
2. Testing a Difference Between Two Means
In the last lecture we learned how to test whether a single group mean differs from some
hypothesized value. Now we will consider a somewhat more common problem: how to test
whether the means of two sample are significantly different from each other.
Example. A university has developed a new method for teaching statistics, and wants to know if
it's better than the old method. Two classes are taught, one using the old, and one using the
new method. At semester's end, students in both classes take the same test. If the new
method is better, then the average score of students in the new course should be higher than
the average of students in the old course. How to verify this?
From the statistical standpoint, this problem is almost exactly the same as testing a single
mean. That is because the difference between two sample means has a known sampling
distribution (either standard normal, or a t distribution), just as before.
Our procedure involves the same steps as for testing a single mean:






supply the null hypothesis (e.g., H0: μ1 = μ2 )
supply an alternative hypothesis (e.g., H1: μ1 ≠ μ2 )
choose an α level (e.g., 0.05)
calculate a z (if population variance known) or t statistic (if not)
compute a p-value – i.e., the area in the tail(s) of the sampling distribution
if p ≤ α, reject null hypothesis
The only difference is in our formulas for computing the z or t test statistic.
3. Video(s)
Difference of Sample Means Distribution
http://www.youtube.com/watch?v=TcIDXqmt74A
Hypothesis Test for Difference of Means
http://www.youtube.com/watch?v=N984XGLjQfs
4. Formulas
Comparing Two Means: Independent Samples
If the variances of two normal populations were known, we would base tests and confidence
intervals on the following ratio which has a normal distribution if the samples are large or taken
from normal populations:
Statistics 312 – Dr. Uebersax
21 – Tests of Two Sample Means
( - ) - ( -  )
z = x1 x 2 2 1 2 2 .
1 +  2
n1 n 2
There is nothing mysterious here. This is our basic z formula. We are merely applying it to a
sampling distribution of the difference between two means.
We are helped by the fact that the variance of the sampling distribution for the difference
between two means is equal to the sum of the variances of the sampling distributions for the
individual means. That is:

2
X1X 2
  X1  X 2
2
2
if the two groups are statistically independent. (We will talk about what happens when two
groups are non-independent in a later lecture).
Because the population variances are usually unknown, we base most inferences on the tdistribution. There are two available t statistics (and confidence intervals), both requiring that
the samples are large or taken from normal populations. The first (p. 415), a pooled-variance
two-sample t statistic, requires an assumption that the variances of the two populations are
equal; i.e.,  12   22 . The second (p. 418), a separate-variance two-sample t statistic, does not
require equality of the two variances. We will use the separate-variance two-sample t statistic:
( - ) - (  1 -  2)
.
t = x1 x 2 2
2
s1 + s2
n1 n 2
The test statistic t follows a t distribution with n1 + n2 – 2 degrees of freedom.
5. Test of Two Means Using JMP
1.
2.
3.
4.
5.
6.
7.
8.
9.
Start JMP
Make new Data Table
Paste/type data into Data Table
Note: ne column will have continuous scores (Y variable) and the other (X variable) will
have a group designator (1 vs. 2).
Right-click the top of the column with the X variable
In dropdown menu, check Modeling Type > Nominal (this will treat that variable as a
group identifier)
Highlight columns with the Y and X variables.
Analyze > Fit Y by X
Designate Y (Response) and X (Factor) variables in pop-up window, press OK
Statistics 312 – Dr. Uebersax
21 – Tests of Two Sample Means
Step 8
Step 9
10. A report like the following will appear.
11. Click red arrow of report and select t-test.
Step 10
12. Results appear in new section of report.
Step 11
Statistics 312 – Dr. Uebersax
21 – Tests of Two Sample Means
Step 12
Homework: Read pp. 413–420. Look at pooled-variance t-test formulas, but we will not use.
Work Problem 9.14.
 data are in phone.xls (don't paste the names 'Time' and 'Location' into JMP)
 Use JMP
 Parts (a) and (d) only
 Assume population variances are unequal.
Download