Post on 03-Apr-2018
7/28/2019 8 Students t test
1/26
Students t test
This test was invented by astatistician working for the
brewer Guinness. He was calledWS Gosset (1867-1937), butpreferred to keep anonymous so
wrote under the nameStudent.
7/28/2019 8 Students t test
2/26
The t-distribution
William Gossetlived from 1876 to 1937
Gosset invented the t-test to handle small samples for quality
control in brewing. He wrote under the name "Student".
7/28/2019 8 Students t test
3/26
t-Statistic
ns
xt
/
When the sampled population isnormally distributed, the t statistic isStudent t distributed with n-1 degrees
of freedom.
7/28/2019 8 Students t test
4/26
T-test1. Test for single mean
Whether the sample mean is equal to the predefinedpopulation mean ?
2. Test for difference in means
Whether the CD4 level of patients taking treatment A is
equal to CD4 level of patients taking treatment B ?
3. Test for paired observationWhether the treatment conferred any significant benefit ?
7/28/2019 8 Students t test
5/26
T- test for single meanThe following are the weight (mg) of each of 20rats drawn at random from a large stock. Is it
likely that the mean weight for the whole stock
could be 24 mg, a value observed in some previous
work?.
9 18 21 26
14 18 22 27
15 19 22 29
15 19 24 30
16 20 24 32
7/28/2019 8 Students t test
6/26
Steps for test for single mean1. Questioned to be answered
Is the Mean weight of the sample of 20 rats is 24 mg?N=20, =21.0 mg, sd=5.91 , =24.0 mg
2. Null Hypothesis
The mean weight of rats is 24 mg. That is, Thesample mean is equal to population mean.
3. Test statistics --- t (n-1) df
4. Comparison with theoretical value
if tab t (n-1) < cal t (n-1) reject Ho,
if tab t (n-1) > cal t (n-1) accept Ho,
5. Inference
ns
xt
/
x
7/28/2019 8 Students t test
7/26
t test for single mean
Test statisticsn=20, =21.0 mg, sd=5.91 ,=24.0 mg
t
= t .05, 19 = 2.093 Accept H0 if t < 2.093
Reject H0 if t >= 2.093
x
30.22091.5
240.21
llt
Inference :
There is no evidence that the sample is taken
from the population with mean weight of 24 gm
7/28/2019 8 Students t test
8/26
7/28/2019 8 Students t test
9/26
-1.
96
0
Area = .025
Area =.005
Z
-2.
575
Area = .025
Area = .005
1.
96
2.
575
Determining the p-Value
7/28/2019 8 Students t test
10/26
.9
5
t0
f(t)
-1.96 1.96
.025025
red area = rejection region for 2-sided test
7/28/2019 8 Students t test
11/26
Given below are the 24 hrs total energyexpenditure (MJ/day) in groups of lean and
obese women. Examine whether the obesewomens mean energy expenditure issignificantly higher ?.
Lean6.1 7.0 7.5
7.5 5.5 7.6
7.9 8.1 8.1
8.1 8.4 10.2
10.9
T-test for difference in means
Obese8.8 9.2 9.2
9.7 9.7 10.0
11.5 11.8 12.8
7/28/2019 8 Students t test
12/26
Two sample t-test
Difference
between means
Sample size
Variability
of data
t-test t++
7/28/2019 8 Students t test
13/26
7/28/2019 8 Students t test
14/26
T-test for difference in means
Data Summarylean Obese
N 13 9
8.10 10.30
S 1.38 1.25
82.3
13
25.1
9
32.1
3.101.822
llt
Inference : The cal t (3.82) is higher than tab t at0.05, 20. ie 2.086 . This implies that there is a
evidence that the mean energy expenditure in obese
group is significantly (p
7/28/2019 8 Students t test
15/26
7/28/2019 8 Students t test
16/26
Example
Suppose we want to test the
effectiveness of a program designedto increase scores on the quantitativesection of the Graduate Record Exam
(GRE). We test the program on agroup of 8 students. Prior to enteringthe program, each student takes a
practice quantitative GRE; aftercompleting the program, each studenttakes another practice exam. Basedon their performance, was the
program effective?
7/28/2019 8 Students t test
17/26
Each subject contributes 2 scores:repeated measures design
Student Before Program After Program
1 520 555
2 490 510
3 600 585
4 620 645
5 580 630
6 560 550
7 610 645
8 480 520
h d i h i l
7/28/2019 8 Students t test
18/26
Can represent each student with a singlescore: the difference (D) between thescores
Student
Before Program After Program
D1 520 555 35
2 490 510 20
3 600 585 -15
4 620 645 25
5 580 630 50
6 560 550 -10
7 610 645 35
8 480 520 40
7/28/2019 8 Students t test
19/26
Approach: test the effectiveness ofprogram by testing significance of D
Alternative hypothesis: program iseffective scores after program willbe higher than scores before
program average D will be greaterthan zero
H0: D 0H1: D > 0
S d t k D d D2
7/28/2019 8 Students t test
20/26
Student
Before
Program
After
Program D D2
1 520 555 35 1225
2 490 510 20 400
3 600 585 -15 225
4 620 645 25 625
5 580 630 50 2500
6 560 550 -10 100
7 610 645 35 1225
8 480 520 40 1600
D = 180 D2 = 7900
So, need to know D and D2:
7/28/2019 8 Students t test
21/26
Recall that for single samples:
errorstandard
mean-score
X
obt
s
Xt
For related samples:
D
D
obt
s
Dt
where:
N
ss
D
D and
1
2
2
N
N
DD
sD
7/28/2019 8 Students t test
22/26
45.23
18
81807900
1
22
2
N
N
DD
sD
5.22
8
180
N
DD
Standard deviation of D:
Mean of D:
Standard error:
2908.88
45.23
N
ss
D
D
7/28/2019 8 Students t test
23/26
D
D
obt
s
Dt
Under H0, D = 0, so:
714.2
2908.8
5.22
D
obt
s
Dt
From Table B.2: for = 0.05, one-tailed, with df = 7,
tcrit
= 1.895
2.714 > 1.895 reject H0
The program is effective.
7/28/2019 8 Students t test
24/26
7/28/2019 8 Students t test
25/26
t-Valuet is a measure of:
How difficult is it to believe the null hypothesis?
High t
Difficult to believe the null hypothesis -accept that there is a real difference.
Low tEasy to believe the null hypothesis -
have not proved any difference.
7/28/2019 8 Students t test
26/26
In Conclusion !
Student s t-test will be used:
--- When Sample size is small
and for the following situations:
(1) to compare the single sample meanwith the population mean
(2) to compare the sample means of
two indpendent samples
(3) to compare the sample means ofpaired samples