Вы находитесь на странице: 1из 26

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

By the end of this session, the students should be able to:

Review last lecture

 Learn when two independent sample t- test being employed

Discuss the assumptions of t- test for two independent


sample

 Calculate two independent sample- test

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

• The confidence interval using the t-statistic


is wider than the corresponding confidence
interval using the standard z-statistic.

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 withsmall 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?

– A researcher was interested in whether treatment A is better than


treatment B for the reduction of the size of abscess. For this purpose
he randomly divided patients into two groups and gave treatment A to
the first group and treatment B to the second group, the size of the
abscess was observed clinically after one week of initiation of
therapy.

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.

– The researcher was interested in the effectiveness of a particular


diet used by a slimming center. For that purpose weight of the
clients before and after the use of that diet was observed.

13
Is this dependent or independent samples situation?

– A researcher was interested in the effect of smoking during


Pregnancy and Lactation on Breast-Milk Volume. According to his
claim: “Non-smoking mothers had significantly greater breast milk
volume than did smokers”. To test this claim a group of smoking
mothers and another group of non-smoking mothers was randomly
selected and observed for their breast milk volume.

14
Hypothesis Tests for
Two Population Means

Lower tail test: Upper tail test: Two-tailed test:

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)

Test value= (observed value)-(expected value)


standard error
17
T-test for two independent sample
Now since 2 is unknown, we need to find an
estimate for it. Using the variances from the
two samples S21 & S22 we obtain an improved
estimate for 2 called the pooled sample
variance, Sp2

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?

No Health Education Health Education

Number 25 ( n1 ) 27 ( n2 )
of mothers (n)

Mean score (X) 12.5 ( X1 ) 16.4 (X2 )

Standard Deviation (S) 4.5 ( S1 ) 4.2 ( S2 )

21
Example 1 cont…..
H0: 1 = 2
Ha 1:  2

 = 0.05

t = (X1 -X2) .
Sp2 (1/ n1 + 1/ n2 )

Sp2 = (n1 - 1) S12 + (n2 -1) S22


n1 + n2 -2

Sp2 = (25-1) (4.5)2 + (27-1) (4.2)2 = 18.89


25 + 27 -2

t = (12.5 - 16.4) = - 3.23


 18.89 (1/25 + 1/27)

22
23
Example 1 cont…
R.R.:
Degrees of freedom = 50
Reject Ho if
tcal > ttab or tcal <- ttab
Hence tcal < - 2.01

P-value: < 0.01 * 2 = 0.02

Since tcal= -3.32 falls in critical region so we reject null hypothesis at 5%


level of significance and we have sufficient evidence to conclude that the
knowledge about pregnancy differs for the two groups.

24
(1-)% Confidence Interval for (1 - 2) -Independent
Sampling (when withsmall samples

• Both populations must be approximately normally


distributed with equal variances (these variances are usually
unknown):

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

Вам также может понравиться