146 30 difference_of_two_means
Transcript of 146 30 difference_of_two_means
![Page 1: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/1.jpg)
MATH& 146
Lesson 30
Section 4.3
Difference of Two Means
1
![Page 2: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/2.jpg)
Difference of Two Means
For this lesson, we will consider a difference in two
population means, μ1 – μ2, under the condition that
the data are not paired.
For instance, a teacher might like to test the notion
that two versions of an exam were equally difficult.
He could do so by randomly assigning each
version to students.
2
![Page 3: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/3.jpg)
Difference of Two Means
If he found that the average scores on the exams
were so different that he cannot write it off as
chance, then he may want to award extra points to
students who took the more difficult exam.
The teacher would like to evaluate whether there is
convincing evidence that the difference in average
scores between the two exams is not due to
chance.
3
![Page 4: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/4.jpg)
Point Estimates
To start, the teacher would need a "best guess" for
the differences, based on the sample data. This
"best guess" is called the point estimate:
4
1 2 1 2 is a point estimate for x x
![Page 5: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/5.jpg)
Conditions for Inference
The t distribution can be used for inference when
working with the standardized difference of two
means if the following two conditions are met.
1) Each sample meets the conditions for using the
t distribution (independence and nearly normal
data).
2) The samples are independent of each other.
5
![Page 6: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/6.jpg)
Conditions for Inference
For instance, if the teacher believes students in his
class took the test independently of each other,
exam scores followed a normal distribution, and
the two groups of students taking the different
versions of the exam were unpaired, then we can
use the t distribution for inference on the point
estimate
6
1 2.x x
![Page 7: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/7.jpg)
Standard Error
The formula for the standard error of is
given below:
7
1 2x x
1 2 1 2
2 22 2 1 2
1 2x x x x
s sSE SE SE
n n
![Page 8: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/8.jpg)
Example 1
Calculate the standard error for the difference of
two means if the first sample had 21 observations
with a mean of 12.6 and standard deviation of 3.2.
and the second sample had 30 observations with a
mean of 17.8 and standard deviation of 4.1.
8
1 2 1 2
2 22 2 1 2
1 2x x x x
s sSE SE SE
n n
![Page 9: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/9.jpg)
Degrees of Freedom
Because we will use the t distribution, we will need
to identify the appropriate degrees of freedom.
This can be done using either computer software
or a lot of free time:
22 21 2
1 2
2 22 21 2
1 1 2 2
df
1 1
1 1
s s
n n
s s
n n n n
9
![Page 10: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/10.jpg)
Degrees of Freedom
(Modified)
An alternate formula (and the one we will use) is to
use the smaller of n1 – 1 and n2 – 1, which is the
method we will apply in the examples and exercises.
Although the modified formula will result in different
degrees of freedom from the actual formula, the
conclusion of a test will rarely be affected by the
choice.
df the smaller of the sample sizes, minus one
10
![Page 11: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/11.jpg)
Different Exams
Summary statistics for each exam version are
shown below. The teacher would like to evaluate
whether this difference is so large that it provides
convincing evidence that Version B was more
difficult (on average) than Version A.
11
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 12: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/12.jpg)
Example 2
Construct a two-sided hypothesis test to evaluate
whether the observed difference in sample means,
, might be due to
chance.
That is, write the hypotheses to test whether the
two sample means are different from each other.
12
79.4 74.1 5.3A Bx x
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 13: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/13.jpg)
Example 3
a) Does it seem reasonable that the scores are
independent within each group?
b) Does it seem reasonable that the distribution of
each group is approximately normal?
c) Do you think scores from the two groups would be
independent of each other (i.e. the two samples
are independent)?
13
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 14: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/14.jpg)
Example 4
Compute the standard error for the point estimate.
14
1 2 1 2
2 22 2 1 2
1 2x x x x
s sSE SE SE
n n
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 15: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/15.jpg)
Example 5
Next, construct the test statistic.
15
point estimate null valueT
SE
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 16: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/16.jpg)
Example 6
Identify the p-value, as shown in the figure. and
provide a conclusion in the context of the case study?
16
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 17: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/17.jpg)
Example 7
The actual degrees of freedom are approximately
df = 45.9726, giving a p-value of 0.25728. How does
our calculation of the p-value in the previous example
compare?
17
Version n s min max
A 30 79.4 14 45 100
B 27 74.1 20 32 100
x
![Page 18: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/18.jpg)
Baby Smoke
The data set below represents a random sample of
150 cases of mothers and their newborns in North
Carolina over a year. Four cases from this data set
are represented in the table below. The value "NA",
shown for the first two entries of the first variable,
indicates that piece of data is missing.
18
fAge mAge weeks weight sexBaby smoke
1 NA 13 37 5.00 female nonsmoker
2 NA 14 36 5.88 female nonsmoker
3 19 15 41 8.13 male smoker
⁞ ⁞ ⁞ ⁞ ⁞ ⁞ ⁞
150 45 50 36 9.25 female nonsmoker
![Page 19: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/19.jpg)
Baby Smoke
We are particularly interested in two variables:
weight and smoke. The weight variable represents
the weights of the newborns and the smoke
variable describes which mothers smoked during
pregnancy.
19
fAge mAge weeks weight sexBaby smoke
1 NA 13 37 5.00 female nonsmoker
2 NA 14 36 5.88 female nonsmoker
3 19 15 41 8.13 male smoker
⁞ ⁞ ⁞ ⁞ ⁞ ⁞ ⁞
150 45 50 36 9.25 female nonsmoker
![Page 20: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/20.jpg)
Baby Smoke
We would like to know if there is convincing
evidence that newborns from mothers who smoke
have a different average birth weight than
newborns from mothers who don't smoke. We will
use the North Carolina sample to try to answer this
question.
20
fAge mAge weeks weight sexBaby smoke
1 NA 13 37 5.00 female nonsmoker
2 NA 14 36 5.88 female nonsmoker
3 19 15 41 8.13 male smoker
⁞ ⁞ ⁞ ⁞ ⁞ ⁞ ⁞
150 45 50 36 9.25 female nonsmoker
![Page 21: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/21.jpg)
Baby Smoke
The top histogram
represents birth weights
for infants whose mothers
smoked. The bottom
histogram represents the
birth weights for infants
whose mothers who did
not smoke. Both
distributions exhibit strong
skew.
21
![Page 22: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/22.jpg)
Example 8
Use μNS – μS as the parameter to set up appropriate
hypotheses to evaluate whether there is a relationship
between a mother smoking and average birth weight.
Use the summary statistics below and make sure to
check the conditions.
22
smoker nonsmoker
6.78 7.18
1.43 1.60
50 100
x
s
n
![Page 23: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/23.jpg)
Example 9
Given our conclusion, could we have made a Type
1 or a Type 2 Error?
What could we have done differently in data
collection to be more likely to detect such a
difference?
23
![Page 24: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/24.jpg)
Summary for Inference of
the difference of two means
When considering the difference of two means,
there are two common cases: either the two
samples are paired or they are independent.
When applying the normal model to the point
estimate x (corresponding to unpaired data),
it is important to verify conditions before applying
the inference framework using the normal model.
24
1 2x x
![Page 25: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/25.jpg)
Summary for Inference of
the difference of two means
First, each sample mean must meet the conditions
for normality: independent observations and not
too much skew (This second condition can be
relaxed as the sample sizes increase.)
Second, the samples must be collected
independently (e.g. not paired data).
When these conditions are satisfied, the general
tools of inference may be applied.
25
![Page 26: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/26.jpg)
Two Sample Tests from
Start to Finish
1) Verify you have data from two samples that are
independent of each other.
2) State the hypotheses using μ1 – μ2.
3) Check the independence and normality conditions
for each sample.
4) Calculate the point estimate and standard error:
26
continued
1 2
2 2
1 2
1 2x x
s sSE
n n 1 2Pt. Est. x x
![Page 27: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/27.jpg)
Two Sample Tests from
Start to Finish
5) Calculate the test statistic using
6) Calculate the p-value. Use df = the smaller of the
sample sizes, minus 1.
• For left-tail tests, use tcdf(–999, T, df)
• For right-tail tests, use tcdf(T, 999, df)
• For two-tail tests, use tcdf(|T|, 999, df) × 2
27
1 2
1 2 0point estimate null value
x x
x xT
SE SE
continued
![Page 28: 146 30 difference_of_two_means](https://reader031.fdocuments.in/reader031/viewer/2022030402/58a3c1151a28ab62218b6975/html5/thumbnails/28.jpg)
Two Sample Tests from
Start to Finish
7) Compare the p-value to α and make a conclusion.
• If p-value < α, then this would be considered
enough evidence to reject H0.
• If p-value ≥ α, then this would be considered
insufficient to reject H0.
28