Student's t-test
Student's t-test is a statistical test used to test whether the difference between the response of two groups is statistically significant or not. It is any statistical hypothesis test in which the test statistic follows a Student's t-distribution under the null hypothesis. It is most commonly applied when the test statistic would follow a normal distribution if the value of a scaling term in the test statistic were known. When the scaling term is estimated based on the data, the test statistic—under certain conditions—follows a Student's t distribution. The t-test's most common application is to test whether the means of two populations are significantly different. In many cases, a Z-test will yield very similar results to a t-test because the latter converges to the former as the size of the dataset increases.
History
The term "t-statistic" is abbreviated from "hypothesis test statistic". In statistics, the t-distribution was first derived as a posterior distribution in 1876 by Helmert and Lüroth. The t-distribution also appeared in a more general form as Pearson type IV distribution in Karl Pearson's 1895 paper. However, the t-distribution, also known as Student's t-distribution, gets its name from William Sealy Gosset, who first published it in English in 1908 in the scientific journal Biometrika using the pseudonym "Student" because his employer preferred staff to use pen names when publishing scientific papers. Gosset worked at the Guinness Brewery in Dublin, Ireland, and was interested in the problems of small samples for example, the chemical properties of barley with small sample sizes. Hence a second version of the etymology of the term Student is that Guinness did not want their competitors to know that they were using the t-test to determine the quality of raw material. Although it was William Gosset after whom the term "Student" was coined, it was actually through the work of Ronald Fisher that the distribution became well known as "Student's distribution" and "Student's t-test".Gosset devised the t-test as an economical way to monitor the quality of stout. The t-test work was submitted to and accepted in the journal Biometrika and published in 1908.
Guinness had a policy of allowing technical staff leave for study, which Gosset used during the first two terms of the 1906–1907 academic year in Professor Karl Pearson's Biometric Laboratory at University College London. Gosset's identity was then known to fellow statisticians and to editor-in-chief Karl Pearson.
Uses
One-sample ''t''-test
A one-sample Student's t-test is a location test of whether the mean of a population has a value specified in a null hypothesis. In testing the null hypothesis that the population mean is equal to a specified value, one uses the statisticwhere is the sample mean, is the sample standard deviation and is the sample size. The degrees of freedom used in this test are. Although the parent population does not need to be normally distributed, the distribution of the population of sample means is assumed to be normal.
By the central limit theorem, if the observations are independent and the second moment exists, then will be approximately normal. This is only an approximation as the central limit theorem would apply to if was the actual standard deviation of, while it is the sample standard deviation as the actual standard deviation is not generally known. Therefore, asymptotically follows a Student's t-distribution.
Two-sample ''t''-tests
A two-sample location test of the null hypothesis that the means of two populations are equal. All such tests are usually called Student's t-tests, though strictly speaking that name should only be used if the variances of the two populations are also assumed to be equal; the form of the test used when this assumption is dropped is sometimes called Welch's t-test. These tests are often referred to as unpaired or independent samples ''t-tests, as they are typically applied when the statistical units underlying the two samples being compared are non-overlapping.Two-sample t''-tests for a difference in means involve independent samples or paired samples. Paired t-tests are a form of blocking, and have greater power than unpaired tests when the paired units are similar with respect to "noise factors" that are independent of membership in the two groups being compared. In a different context, paired t-tests can be used to reduce the effects of confounding factors in an observational study.
Independent (unpaired) samples
The independent samples t-test is used when two separate sets of independent and identically distributed samples are obtained, and one variable from each of the two populations is compared. For example, suppose we are evaluating the effect of a medical treatment, and we enroll 100 subjects into our study, then randomly assign 50 subjects to the treatment group and 50 subjects to the control group. In this case, we have two independent samples and would use the unpaired form of the t-test.Paired samples
s t-tests typically consist of a sample of matched pairs of similar units, or one group of units that has been tested twice.A typical example of the repeated measures t-test would be where subjects are examined prior to a treatment, say for high blood pressure, and the same subjects are examined again after treatment with a blood-pressure-lowering medication. By comparing the same patient's numbers before and after treatment, we are effectively using each patient as their own control. That way the correct rejection of the null hypothesis can become much more likely, with statistical power increasing simply because the random inter-patient variation has now been eliminated. However, an increase of statistical power comes at a price: more examinations are required, each subject having to be examined twice.
Because half of the sample now depends on the other half, the paired version of Student's t-test has only degrees of freedom. Pairs become individual test units, and the sample has to be doubled to achieve the same number of degrees of freedom. Normally, there are degrees of freedom.
A paired samples t-test based on a "matched-pairs sample" results from an unpaired sample that is subsequently used to form a paired sample, by using additional variables that were measured along with the variable of interest. The matching is carried out by identifying pairs of values consisting of one observation from each of the two samples, where the pair is similar in terms of other measured variables. This approach is sometimes used in observational studies to reduce or eliminate the effects of confounding factors.
Paired samples t-tests are often referred to as "dependent samples t-tests".
Assumptions
Most test statistics have the form, where and are functions of the data.may be sensitive to the alternative hypothesis, whereas is a scaling parameter that allows the distribution of to be determined.
As an example, in the one-sample t-test
where is the sample mean from a sample, of size, is the standard error of the mean, is the estimate of the standard deviation of the population, and is the population mean.
The assumptions underlying a t-test in the simplest form above are that:
- follows a normal distribution with mean and variance.
- follows a distribution with degrees of freedom. This assumption is met when the observations used for estimating come from a normal distribution.
- and are independent.
- The means of the two populations being compared should follow normal distributions. Under weak assumptions, this follows in large samples from the central limit theorem, even when the distribution of observations in each group is non-normal.
- If using Student's original definition of the t-test, the two populations being compared should have the same variance. If the sample sizes in the two groups being compared are equal, Student's original t-test is highly robust to the presence of unequal variances. Welch's t-test is insensitive to equality of the variances regardless of whether the sample sizes are similar.
- The data used to carry out the test should either be sampled independently from the two populations being compared or be fully paired. This is in general not testable from the data, but if the data are known to be dependent, a dependent test has to be applied. For partially paired data, the classical independent t-tests may give invalid results as the test statistic might not follow a t distribution, while the dependent t-test is sub-optimal as it discards the unpaired data.
For exactness, the t-test and Z-test require normality of the sample means, and the t-test additionally requires that the sample variance follows a scaled χ distribution, and that the sample mean and sample variance be statistically independent. Normality of the individual data values is not required if these conditions are met. By the central limit theorem, sample means of moderately large samples are often well-approximated by a normal distribution even if the data are not normally distributed. However, the sample size required for the sample means to converge to normality depends on the skewness of the distribution of the original data. The sample can vary from 30 to 100 or higher values depending on the skewness.
For non-normal data, the distribution of the sample variance may deviate substantially from a χ distribution.
However, if the sample size is large, Slutsky's theorem implies that the distribution of the sample variance has little effect on the distribution of the test statistic. That is, as sample size increases: