Cermain's introduction to the t-test is fairly accurate, but I feel lacks
some information.
The t-test is a statistical tes twhich allows you to compare two independent
samples or to compare a single sample against a theoretical mean. It is a
univariate procedure, meaning that you can only compare the values of one
variable at a time.
The two statistical hypotheses normally tested are:
- H_{0}: The mean for sample 1 is equal to the mean for sample
two, or μ_{1}=μs_{2}
- H_{1}: The mean for sample 1 is not equal to the mean for
sample two, or μ_{1} ≠ μ_{2}. (note that this can be
modified to include the unilateral case)
The
auxiliary statistic t (the value compared against a theoretical
distribution) is calculated as:
t_{c} =
(mean(x_{1})-mean(x_{2}))/s_{pd}√(1/n_{1}
+1/n_{2})
This value of t is compared against the Student's t distribution with
ν=n_{1}+n_{2}-2 degrees of freedom.
The conditions of the t-test are as follows:
- The samples be independent
- The two samples be distributed normally
- The variances of the two samples are equal
If the two variances are not equal, then a modified version of the test may be
applied.
t_{mc} =
(mean(x_{1})-mean(x_{2}))/√(s^{2}_{x1
}/n_{1} +s^{2}_{x2}/n_{2})
Where t_{mc} is compared with the theoretical Student's t
distribution with a modified number of degrees of freedom. There is also a
modification of the t-test under the circumstances where the two samples are
paired (an example of this situation is where you take a measurement of a
subject before and after a manipulation; the samples are not independent
because the same subject is measured twice).
t_{d} = mean(d)/s_{mean(d)}
where mean(d) and s_{d} are the mean value and standard deviation of
the differences between sample 1 and sample 2 for each subject, and
s_{mean(d)}=s_{d}/√n and s_{d}.