Download Lecture 21

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
COMPARING TWO POPULATIONS
IDEA: Compare two groups/populations based on samples from each of
them.
Examples.
 Compare average height of men and women. Draw sample of men
heights: x1, x2, …, xm and a sample of women heights: y1, y2, …, yn.
Test Ho:
Ho: μx = μy
vs
Ha: μx ≠ μy or Ha: μx > μy
 Compare proportions of Democrats in two cities,
 Compare weights of people before and after a diet, etc.
General considerations for the samples: Dependent or independent
samples.
Example. Comparing weights of people before and after a diet we have
dependent (same people) samples of weights. Comparing weights of
people in two cities we have independent samples. Analysis methods
will differ for dependent and independent samples.
PAIRED t-TEST: dependent samples
Observations come as matched pairs (X,Y).
X and Y are NOT independent, X and Y are dependent.
Examples.

X is score on a test before studying hard; Y is score on the test after
studying hard for the same student;

X is score on a test or in sports before training program, Y score
after training program;

X is weight before weight loss program, Y is weight after the
program;

X and Y are heights of twins or siblings.
PAIRED t-TEST: HYPOTHESES
Hypotheses of interest: does training make a difference?
μx = score before training;
Ho: μx = μy
(no difference)
μy = score after training.
vs
Ha: μx < μy
(score after training is higher)
Data are pairs of observations: (x1, y1), (x2, y2), …, (xn, yn).
Typically, we work with differences: d=X-Y, and phrase hypotheses in
terms of differences: μd = true mean difference.
In terms of differences:
Hypotheses
e.g. Ho: μd = 0 vs Ha: μd < 0
Data: d1, d2, …, dn.
obs before after difference
1
x1
y1
d1=x1-y1
2
x2
y2
d2=x2=y2
.
.
.
.
n
xn
yn
dn=xn-yn
PAIRED t-TEST: TEST PROCEDURE
To test Ho, we do one sample t-test. Need sample mean and standard
deviation of d’s:
n
1 n
d   di and sd2 
n i 1
Compute the test statistic:
2
(
d

d
)
 i
i 1
n 1
.
d
t
.
sd / n
Under Ho the test statistic has t(n-1) distribution.
Make decision in exactly the same way as for the one sample t-test.
A (1-α)100% CI for d:
sd
d  t /2 (n  1)
.
n
PAIRED t-TEST: an example
The amount of lactic acid in the blood was examined for 10 men, before
and after a strenuous exercise, with the results in the following table.
(a) Test if exercise changes the level of lactic acid in blood. Use
significance level α=0.01.
(b) Find a 95% CI for the mean change in the blood lactose level.
Before
15
16
13
13
17
20
13
16
14
18
After
33
20
30
35
40
37
18
26
21
19
PAIRED t-TEST: lactic acid example contd.
Solution. Take d=“After level” – “before level” of lactic acid.
Data for d: 18, 4, 17, 22, 23, 17, 5, 10, 7, 1. Sample stats:
d  12.4 and sd2  63.156.
STEP1. Ho: μd = 0 vs Ha: μd ≠ 0
STEP 2. Test statistic:
t
d
12.4

 4.93.
sd / n 7.95 / 10
STEP 3. Critical value? df=n-1=9, tα/2 =t0.005=3.69.
STEP 4. DECISION: t = 4.93 > 3.69 = t0.005 , so reject Ho.
STEP 5. Exercise changes lactic acid level.
Example contd.
(b) Find a 95% CI for the mean change in the blood lactose level.
d  t /2
sd
n
It is the familiar formula for the 95% CI for the mean, this time mean
difference μd. Need percentile from the t distribution with n-1 degrees of
freedom.
n=10, n-1=9, α=0.05, so tα/2 =t0.025=2.262, so the 95% CI for μd is:
7.947
12.4  2.262
 12.4  5.6845  (6.716,18.086).
10
Lactic acid example in MINITAB: data set lactic-acid.MPJ
Lactic acid example in MINITAB: data set lactic-acid.MPJ
Paired T-Test and Confidence Interval
Paired T for before - after
before
after
Difference
N
10
10
10
Mean
15.50
27.90
-12.40
StDev
2.37
8.17
7.95
SE Mean
0.75
2.58
2.51
95% CI for mean difference: (-18.08, -6.72)
T-Test of mean difference = 0 (vs not = 0): T-Value = -4.93
0.001
Ho
P-Value =
Histogram of Differences
Ha
(with Ho and 95% t-confidence interval for the mean)
3
Note: CI for “Before –after”
2
Frequency
Conclusion: Reject Ho, lactic
acid level changes after
exercise.
1
_
X
0
[
-25
-20
-15
Ho
]
-10
Differences
-5
0