Title: Two Population Means
1- Two Population Means
- Hypothesis Testing and Confidence Intervals
- With Unknown
- Standard Deviations
2The Problem
- ?1 or ?2 are unknown
- ?1 and ?2 are not known (the usual case)
- OBJECTIVES
- Test whether ?1 gt ?2 (by a certain amount)
- or whether ?1 ? ?2
- Determine a confidence interval for the
difference in the means ?1 - ?2
3KEY ASSUMPTIONS
- Sampling is done from two populations.
- Population 1 has mean µ1 and variance s12.
- Population 2 has mean µ2 and variance s22.
- A sample of size n1 will be taken from population
1. - A sample of size n2 will be taken from population
2. - Sampling is random and both samples are drawn
independently. - Either the sample sizes will be large or the
populations are assumed to be normally
distribution.
4Distribution of ?X1 - ?X2
- Since X1 and X2 are both assumed to be normal, or
the sample sizes, n1 and n2 are assumed to be
large, then because ?1 and ?2 are unknown, the
random variable ?X1 -?X2 has a - Distribution -- t
- Mean ?1 - ?2
- Standard deviation that depends on whether or not
the standard deviations of X1 and X2 (although
unknown) can be assumed to be equal - Degrees of freedom that also depends on whether
or not the standard deviations of X1 and X2 can
be assumed to be equal
5Appropriate Standard Deviation For ?X1 -?X2 When
ss Are Known
- Recall the appropriate standard deviation for ?X1
- ?X2 is - Now if ?1 ?2 we can simply call it ? and write
it as - So if the standard deviations are unknown, we
need an estimate for the common variance, ?2.
6Estimating ?2 Degrees of Freedom
- If we can assume that the populations have equal
variances, then the variance of ?X1 - ?X2 is the
weighted average of s12 and s22, weighted by - DEGREES OF FREEDOM
- There are n1- 1 degrees of freedom from the first
sample and n2-1 degrees of freedom from the
second sample, so - Total Degrees of Freedom for the hypothesis test
or confidence interval (n1 -1) (n2 -1) n1
n2 -2
7The Appropriate Standard DeviationFor ?X1 - ?X2
When Are ss Unknown, but Can Be Assumed to Be
Equal
- The best estimate for ?2 then is the pooled
variance, sp2 - Thus the best estimates for the variance and
standard deviation of ?X1 - ?X2 are
8t-Statistic and t-Confidence Interval Assuming
Equal Variances
Confidence Interval
Degrees of Freedom n1 n2 -2
9The Appropriate Standard DeviationFor ?X1 - ?X2
When Are ss Unknown, And Cannot Be Assumed to Be
Equal
- If we cannot assume that the populations have
equal variances, then the best estimate for ?12
is s12 and the best estimate for ?22 is s22. - Thus the best estimates for the variance and
standard deviation of ?X1 - ?X2 are
10t-Statistic and t-Confidence Interval Assuming
Unequal Variances
Confidence Interval
Total Degrees of Freedom
Round the resulting value.
11?s are knownz-distribution
12?s are unknownt-distribution
13Testing whether the Variances Can Be Assumed to
Be Equal
- The following hypothesis test tests whether or
not equal variances can be assumed - H0 s12/s22 1 (They are equal)
- HA s12/s22 ? 1 (They are different)
- This is an F-test!
- If the larger of s12 and s22 is put in the
numerator, then the test is - Reject H0 if F s12/s22 gt Fa/2, DF1, DF2
14Hypothesis Test/Confidence Interval Approach With
Unknown ?s
- Take a sample of size n1 from population 1
- Calculate ?x1 and s12
- Take a sample of size n2 from population 2
- Calculate ?x2 and s22
- Perform an F-test to determine if the variances
can be assumed to be equal - Perform the Appropriate Hypothesis Test or
Construct the Appropriate Confidence Interval
15Example 1
- Based on the following two random samples,
- Can we conclude that women on the average score
better than men on civil service tests? - Construct a 95 for the difference in average
scores between women and men on civil service
tests. - Because the sample sizes are large, we do not
have to assume that test scores have a normal
distribution to perform our analyses.
16Example 1 F-test
- Do an F-test to determine if variances can be
assumed to be equal. - H0 ?W2/?M2 1 (Equal Variances)
- HA ?W2/?M2 ? 1 (Unequal Variances)
- Select a .05.
- Reject H0 (Accept HA) if Larger s2/Smaller s2
gt F.025,DF(Larger s2),DF(Smaller s2)
F.025,31,29 2.09 - Calculation sW2/ sM2 (13.92)2/(11.79)2 1.39
- Since 1.39 lt 2.09, Cannot conclude unequal
variances.
17Example 1 The Equal Variance t-Test
Example 1 The Equal Variance t-Test
- H0 ?W - ?M 0
- HA ?W - ?M gt 0
- Select a .05.
- Reject H0 (Accept HA) if t gt t.05,60 1.658
- Since .608 lt 1.658, we cannot conclude that
- women average better than men on the tests.
18Example 195 Confidence Interval
95 Confidence Interval
2 6.57 -4.57 ?? 8.57
19Example 2
- Based on the following random samples of
basketball attendances at the Staples Center, - Can we conclude that the Lakers average
attendance is more than 2000 more than the
Clippers average attendance at the Staples
Center? - Construct a 95 for the difference in average
attendance between Lakers and Clippers games at
the Staples Center. - Since sample sizes are small, we must assume that
attendance at Lakers and Clipper games have
normal distributions to perform the analyses.
20Example 2 F-test
- Do an F-test to determine if variances can be
assumed to be equal. - H0 ?C2/?L2 1 (Equal Variances)
- HA ?C2/?L2 ? 1 (Unequal Variances)
- Note Clipper variance is the larger sample
variance - Choose a .05.
- Reject H0 (Accept HA) if Larger s2/Smaller s2 gt
F.025,DF(Larger variance),DF(Smaller variance)
F.025,10,12 3.37 - Calculation sC2/ sL2 (3276.73)2/(1014.97)2
10.42 - Since 10.42 gt 3.37, Can conclude unequal
variances. - Do Unequal Variance t-test.
21Degrees of Freedom for the Unequal Variance t-Test
- The degrees of freedom for this test is given by
11.626
This rounded to 12 degrees of freedom.
22Example 2 the t-Test
- Proceed to the hypothesis test for the difference
in means with unequal variances - H0 ?L - ?C 2000
- HA ?L - ?C gt 2000
- Select a .05.
- Reject H0 (Accept HA) if t gt t.05,12 1.782
- Since t 2.595 gt 1.782, we can conclude that the
Lakers average more than 2000 per game more than
the Clippers at the Staples Center.
23Example 295 Confidence Interval
95 Confidence Interval
4666 2238.47 2427.53 ?? 6904.47
24Excel Approach
- F-test, t-test Assuming Equal Variances, t-test
Assuming Unequal Variances are all found in Data
Analysis. - Excel only performs a one-tail F-test.
- Multiply this 1-tail p-value by 2 to get the
p-value for the 2-tail F-test. - Formulas must be entered for the LCL and UCL of
the confidence intervals. - All values for these formulas can be found in the
Equal or Unequal Variance t-test Output.
25Inputting/Interpreting Results From Hypotheses
Tests
- Express H0 and HA so that the number on the right
side is positive (or 0) - The p-value returned for the two-tailed test will
always be correct. - The p-value returned for the one-tail test is
usually correct. It is correct if - HA is a gt test and the t-statistic is positive
- This is the usual case
- If t lt 0, the true p-value is 1 (p-value
printed by Excel) - HA is a lt test and the t-statistic is negative
- This is the usual case
- If tgt0, the true p-value is 1 (p-value printed
by Excel)
26Excel For Example 1 F-Test
27Example 1 F-Test (Contd)
28Example 1 F-Test (Contd)
29Example 1 F-Test (Contd)
High p-value (.371671) Cannot conclude Unequal
Variances Use Equal Variance t-test
30Example 1 t-Test
31Example 1 t-Test (Contd)
32Example 1 t-test (Contd)
High p-value for 1-tail test! Cannot conclude
average womens score gt average mens score
33Example 1 95 Confidence Interval
34Excel For Example 2 F-Test
35Example 2 F-Test (Contd)
36Example 2 F-Test (Contd)
Low p-value (.000352) Can conclude Unequal
Variances Use Unequal Variance t-test
37Example 2 t-Test
38Example 2 t-Test (Contd)
39Example 2 t-test (Contd)
Low p-value for 1-tail test (compared to a
.05)! Can conclude the Lakers average more than
2000 more people per game than the Clippers.
40Example 2 95 Confidence Interval
41Review
- Standard Errors and Degrees of Freedom when
- Variances are assumed equal
- Variances are not assumed equal
- F-statistic to determine if variances differ
- t-statistic and confidence interval when
- Variances are assumed equal
- Variances are not assumed equal
- Hypothesis Tests/ Confidence Intervals for
Differences in Means (Assuming Equal or Unequal
Variances) - By hand
- By Excel