Professional Documents
Culture Documents
ROLL NO : 59425-S020
Mathematically, the t-test takes a sample from each of the two sets and establishes the problem
statement by assuming a null hypothesis that the two means are equal. Based on the applicable
formulas, certain values are calculated and compared against the standard values, and the
assumed null hypothesis is accepted or rejected accordingly.
If the null hypothesis qualifies to be rejected, it indicates that data readings are strong and are
probably not due to chance. The t-test is just one of many tests used for this purpose. Statisticians
must additionally use tests other than the t-test to examine more variables and tests with larger
sample sizes. For a large sample size, statisticians use a z-test. Other testing options include the
chi-square test and the f-test.
The t-test is a parametric test of difference, meaning that it makes the same assumptions about
your data as other parametric tests. The t-test assumes your data:
1. are independent
2. are (approximately) normally distributed.
3. have a similar amount of variance within each group being compared (a.k.a. homogeneity
of variance)
If your data do not fit these assumptions, you can try a nonparametric alternative to the t-test,
such as the Wilcoxon Signed-Rank test for data with unequal variances.
If the groups come from a single population (e.g. measuring before and after an
experimental treatment), perform a paired t-test.
If the groups come from two different populations (e.g. two different species, or people
from two separate cities), perform a two-sample t-test (a.k.a. independent t-test).
If there is one group being compared against a standard value (e.g. comparing the acidity
of a liquid to a neutral pH of 7), perform a one-sample t-test.
If you only care whether the two populations are different from one another, perform
a two-tailed t-test.
If you want to know whether one population mean is greater than or less than the other,
perform a one-tailed t-test.
Your observations come from two separate populations (separate species), so you
perform a two-sample t-test.
You don’t care about the direction of the difference, only whether there is a difference, so
you choose to use a two-tailed t-test.
Performing a t-test
The t-test estimates the true difference between two group means using the ratio of the difference
in group means over the pooled standard error of both groups. You can calculate it manually
using a formula, or use statistical analysis software.
T-test formula
The formula for the two-sample t-test (a.k.a. the Student’s t-test) is shown below.
In this formula, t is the t-value, x1 and x2 are the means of the two groups being compared, s2 is
the pooled standard error of the two groups, and n1 and n2 are the number of observations in each
of the groups.
A larger t-value shows that the difference between group means is greater than the pooled
standard error, indicating a more significant difference between the groups.
You can compare your calculated t-value against the values in a critical value chart to determine
whether your t-value is greater than what would be expected by chance. If so, you can reject the
null hypothesis and conclude that the two groups are in fact different.
In your comparison of flower petal lengths, you decide to perform your t-test using R. The code
looks like this:
T-Test Assumptions
1. The first assumption made regarding t-tests concerns the scale of measurement. The
assumption for a t-test is that the scale of measurement applied to the data collected
follows a continuous or ordinal scale, such as the scores for an IQ test.
2. The second assumption made is that of a simple random sample, that the data is collected
from a representative, randomly selected portion of the total population.
3. The third assumption is the data, when plotted, results in a normal distribution, bell-
shaped distribution curve.
4. The final assumption is the homogeneity of variance. Homogeneous, or equal, variance
exists when the standard deviations of samples are approximately equal.
T-test applications
The T-test is used to compare the mean of two samples, dependent or independent.
It can also be used to determine if the sample mean is different from the assumed mean.
T-test has an application in determining the confidence interval for a sample mean.