T-Test One Sample & Two Sample Independent T-Test
T-Test One Sample & Two Sample Independent T-Test
T-Test One Sample & Two Sample Independent T-Test
1
Type I and type II errors. ... In
statistical hypothesis testing a type I
error is the rejection of a true null
hypothesis (also known as a "false
positive" finding or conclusion), while
a type II error is the non-rejection of a
false null hypothesis (also known as a
"false negative" finding or conclusion).
2
Learning Objectives
3
How to observe value of “t” from t-Tables?
Choose the
desired
probability
for /2
Find t-value in
correct row
and column
Interpretation is
Choose the just like a Z-score.
correct df (n-
2.145 = number of
1)
standard errors
away from mean
4
Small-Sample Test of Hypothesis about
a Mean
• If n is small, we cannot assume that the sample
standard deviation will provide a good
approximation of the population standard
deviation. We must use the t-distribution rather
than the z-distribution to make inferences about
the population mean.
x 0
• Test Statistic: t
s
n
5
Small-Sample Confidence Interval
for population mean ()
s
• Formula - x t , df
2 n
6
Hypothesis Test (One sided, Upper tail)
• H 0: 0
• Ha: 0
• Test statistic:
x 0
t
s
n
• Rejection region: t t ,df
7
Hypothesis Test (One sided, Lower tail)
• H 0: 0
• Ha: 0
• Test statistic:
x 0
t
s
n
• Rejection region: t t , df
8
Hypothesis Test (Two sided, Both tails)
• H 0: 0
• Ha: 0
• Test statistic:
x 0
t
s
n
• Rejection region: t t , df
& t t , df
2 2
9
The t Test for Two Independent
Samples
Compare means of two groups
Experimental—treatment versus control
Existing groups—males versus females
We often collect sample from two independent
normal population
With different means
But identical variance
We draw independent random samples of size n1 & n2
10
Underlying assumptions for Independent
samples t-test (when withsmall samples
1. The samples have been randomly selected from
two independent populations
2. The underlying populations are normally
distributed
3. Homogeneity of variance may be known or
assumed, such that
11
Is this dependent or independent samples situation?
12
– The supervisor of medical ward was interested in observing the
quality of training of nurses. For that purpose, two nurses are
assigned to record the temperature measurements of each
patient separately in a group of patients suffering from
cellulites.
13
Is this dependent or independent samples situation?
14
Hypothesis Tests for
Two Population Means
H0 : μ 1 μ 2 H0 : μ1 ≤ μ2 H 0: μ 1 = μ 2
H1: μ1 < μ2 H 1: μ 1 > μ 2 H1 : μ1 ≠ μ2
15
The t Test for Two Independent
Samples
Notation—subscripts indicate group
X1 , s1 , n 1 X2 , s2, n2
Null and alternative hypotheses
H 0 : 1 2 translates into H 0 : 1 2 0
H : translates into H 1 : 1 2 0
1 1 2
16
Test statistics for two sample t test
The test statistic for μ1 – μ2 is:
t
X 1
X 2 μ1 μ2
1 1
S
2
p
n1 n2
Where d.f = (n1 + n2 – 2)
s 2
n1 1 s
2
1 n2 1 s 2
2
p
n1 n2 2
18
4. Critical region: for significance level α and df = n1+n2-2
Reject H0 if
tcal > ttab
or
tcal <- ttab
5. conclusion
19
Example 1
Suppose an investigator wants to evaluate the impact of health
education on mothers registered to get antenatal care. He asked 25
newly registering mothers, pregnant for the first time, and who have
not received health education to fill out a questionnaire which tests
their knowledge about pregnancy. He wants to compare the knowledge
of these mothers, to those who have had health education.
He selected the second sample from mothers, who are pregnant for the
first time, who are registered with our hospital, but who have attended
health education classes about pregnancy. We give them the same
questionnaire. This is our data:
20
Is there a difference in the knowledge about pregnancy
between these two groups?
Number 25 ( n1 ) 27 ( n2 )
of mothers (n)
21
Example 1 cont…..
H0: 1 = 2
Ha 1: 2
= 0.05
t = (X1 -X2) .
Sp2 (1/ n1 + 1/ n2 )
22
23
Example 1 cont…
R.R.:
Degrees of freedom = 50
Reject Ho if
tcal > ttab or tcal <- ttab
Hence tcal < - 2.01
24
(1-)% Confidence Interval for (1 - 2) -Independent
Sampling (when withsmall samples
2 1 1
( x1 x2 ) t s p
, df n
1 n2
2
s 2p
n1 1 s12 n2 1 s22 & df = n1+n2-2
where
n1 n2 2
25
References
Fundamentals of Biostatistics, Bernard Rosner,
Wadsworth Publishing Company, USA, 1995, Chapter
7, pages: 207-212.
Statistics: The exploration and analysis of data, 3rd
Edition, Jay Devore & Roxy Peck, Brooks/Cole
Publishing Company, 1997, Chapter 8, pages:289-298
& Chapter 9, pages:330-338.
26