6.2.6 Two Sample t-test and Confidence Interval

Assumptions: Observations are independent of one another, if the data comes from a non-normal distribution, n1 > 30 and n2 > 30, and the data come from two independent samples. If the data come from a normal distribution, n1 and n2 can be any size for each sample.

H0 : μ1 = μ2

In the case where the variances are not assumed to be equal,

     ¯x1 - ¯x2
t = ∘-s2---s2.
      n11 + n22

A (1 - α)100% confidence interval for μ is,

(                ∘ ---------                ∘ ---------)
                     2    2                     2    2
( ¯x1 - ¯x2 - tα∕2,r  -s1+  s2-,x¯1 - x¯2 + tα∕2,r   s1-+ s2-) ,
                   n1    n2                    n1   n2

where r equals

       [        ]2
         s21+  s22
r =  ----n1---n2-----.
     (s21∕n1)2-+ (s22∕n2)2
      n1-1     n2-1

The value of r is often not an integer, and in that case the nearest integer rounded down is often used. In the case where the variances are assumed to be equal,

      ¯x1 - ¯x2
t = --∘--1----1.
    sp  n1 + n2

A (1 - α)100% confidence interval for μ is,

(                         ∘ ---------                        ∘  --------)
                            -1-   1--                           1--  -1-
  ¯x1 - ¯x2 - tα∕2,(n1+n2-2)sp  n1 +  n2, ¯x1 - ¯x2 + tα∕2,(n1+n2-2)sp  n1 + n2

where,

     ∘  ---------2-----------2-
        (n1---1)s1 +-(n2---1-)s2-
sp =          n1 + n2 - 2      .