's introduction to the t-test is fairly accurate, but I feel lacks
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:
- H0: The mean for sample 1 is equal to the mean for sample
two, or μ1=μs2
- H1: 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:
This value of t is compared against the Student's t distribution with
ν=n1+n2-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
Where tmc 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).
td = mean(d)/smean(d)
where mean(d) and sd are the mean value and standard deviation of
the differences between sample 1 and sample 2 for each subject, and
smean(d)=sd/√n and sd.