1) Independent t-test

For samples taken from two
normal populations (n1 and n2) with different means m1 and m2 but identical variances s2

Calculate pooled standard
deviation

Sp = Ö (n_{1}-1)S_{1}^{2}
+ (n_{2}-1)S_{2}^{2} / n_{1}+n_{2} –2

Sp = pooled standard deviation
(weighted average of the two samples variances)

S^{2} = 1/n-1 [ Sy_{i}^{2} – (Sy_{i})^{2} / n ]

If n_{1} = n_{2}

Sp = (S_{1}^{2}
+ S_{2}^{2}) / 2

t= ÿ_{ 1 }– ÿ_{
2} / Sp Ö 1/n_{1} + 1/n _{2}

df = n1 + n2 – 2

Ha: 1. m1 > m2

2. m1 < m2

3. m1 ¹ m2

1.
Reject
Ho if t > ta

2.
Reject
Ho if t < ta

3.
Reject
Ho if | t | > ta/2

Example

An experiment was conducted to
compare the mean number of tapeworms in the stomachs of sheep that had been
treated for worms against the mean number of those that were untreated. A
sample of 14 worm-infected sheep was randomly divided into two groups. Seven
were injected with the drug and the remainders were left untreated. After a
period the number of worms were recorded

Treated 18
43 28 50
16 32 13

Untreated 40
54 26 63
21 37 39

Test the hypothesis that there
is no difference in the mean number of worms between the treated and untreated
sheep.

a = 0.05

2) Dependent t-test

Samples taken from two normal
populations (n1 and n2) with different means m1 and m2 but different variances s^{2}

t = ÿ_{1} – ÿ_{
2} / Ö S_{1}^{2}/n_{1}
+ S_{2}^{2}/n_{2}

df = (n_{1}-1)(n_{2}-1)
/ (n_{2}-1)c^{2} + (1-c)^{2}(n_{1}-1)

c = S_{1}^{2}/n_{1}
/ S_{1}^{2}/n_{1} + S_{2}^{2} /n_{2}

Treated 5 13
18 6 4
2 15

Untreated 40
54 26 63
21 37