The calculation of the t-test is based on the formula
$$t = \frac{\overline{x} - \mu}{\sqrt{\frac{s^2}{N}}}$$
where \(\mu\) is the mean of the distribution, x the sample mean, \(s^2\) the sample variance,
and N the sample size.
References
Manning, Christopher D.; Schuetze, Hinrich (1999): Foundations of Statistical Natural Language
Processing. MIT Press: Cambridge, Mass., pp. 163-166.