One sample t test
Overview
The One Sample t Test determines whether the sample mean is statistically
different from a known or hypothesized population mean. The One Sample t Test
is a parametric test.
This test is also known as: Single Sample t Test
The variable used in this test is known as: Test variable
In a One Sample t Test, the test variable is compared against a "test value", which
is a known or hypothesized value of the mean in the population.
Common Uses
The One Sample t Test is commonly used to test the following:
Statistical difference between a sample mean and a known or hypothesized
value of the mean in the population.
Statistical difference between the sample mean and the sample midpoint of the
test variable.
Statistical difference between the sample mean of the test variable and chance.
This approach involves first calculating the chance level on the test variable.
The chance level is then used as the test value against which the sample mean
of the test variable is compared.
Statistical difference between a change score and zero.
This approach involves creating a change score from two variables, and then
comparing the mean change score to zero, which will indicate whether any
change occurred between the two time points for the original measures. If the
mean change score is not significantly different from zero, no significant
change occurred.
Note: The One Sample t Test can only compare a single sample mean to a
specified constant. It cannot compare sample means between two or more groups.
If you wish to compare the means of multiple groups to each other, you will likely
want to run an Independent Samples t Test (to compare the means of two groups)
or a One-Way ANOVA (to compare the means of two or more groups).
Data Requirements
Your data must meet the following requirements:
1. Test variable that is continuous (i.e., interval or ratio level)
2. Scores on the test variable are independent (i.e., independence of observations)
There is no relationship between scores on the test variable
Violation of this assumption will yield an inaccurate p value
3. Random sample of data from the population
4. Normal distribution (approximately) of the sample and population on the test
variable
Non-normal population distributions, especially those that are thick-tailed
or heavily skewed, considerably reduce the power of the test
Among moderate or large samples, a violation of normality may still yield
accurate p values
5. Homogeneity of variances (i.e., variances approximately equal in both the
sample and population)
6. No outliers
Hypotheses
The null hypothesis (H0) and (two-tailed) alternative hypothesis (H1) of the one
sample T test can be expressed as:
H0: µ = x ("the sample mean is equal to the [proposed] population mean")
H1: µ ≠ x ("the sample mean is not equal to the [proposed] population mean")
where µ is a constant proposed for the population mean and x is the sample
mean.
The calculated t value is then compared to the critical t value from the t
distribution table with degrees of freedom df = n - 1 and chosen confidence level.
If the calculated t value > critical t value, then we reject the null hypothesis.
Results interpretation
The table provides basic information about the selected variable, Height, including the
valid (nonmissing) sample size (n), mean, standard deviation, and standard error. In
this example, the mean height of the sample is 68.03 inches, which is based on 408
nonmissing observations.
(A) Test Value: The number we entered as the test value in the One-Sample T Test
window.
(B)t Statistic: The test statistic of the one-sample t test, denoted t. In this example,
t = 5.810. Note that t is calculated by dividing the mean difference (E) by the
standard error mean (from the One-Sample Statistics box).
(C)df: The degrees of freedom for the test. For a one-sample t test, df = n - 1; so
here, df = 408 - 1 = 407.
(D)Sig. (2-tailed): The two-tailed p-value corresponding to the test statistic.
(E) Mean Difference: The difference between the "observed" sample mean (from
the One Sample Statistics box) and the "expected" mean (the specified test
value (A)). The sign of the mean difference corresponds to the sign of the t
value (B). The positive t value in this example indicates that the mean height of
the sample is greater than the hypothesized value (66.5).
(F) Confidence Interval for the Difference: The confidence interval for the
difference between the specified test value and the sample mean.
So, since p < 0.001, we reject the null hypothesis that the sample mean is equal to
the hypothesized population mean and conclude that the mean height of the
sample is significantly different than the average height of the overall adult
population.
Based on the results, we can state the following:
There is a significant difference in mean height between the sample and
the overall adult population (p < .001).
The average height of the sample is about 1.5 inches taller than the
overall adult population average.
Independent sample t test
Overview
The Independent Samples t Test compares the means of two independent groups in
order to determine whether there is statistical evidence that the associated
population means are significantly different. The Independent Samples t Test is a
parametric test.
This test is also known as:
Independent t Test
Independent Measures t Test
Independent Two-sample t Test
Student t Test
Two-Sample t Test
Uncorrelated Scores t Test
Unpaired t Test
Unrelated t Test
The variable used in this test is known as: Dependent variable, or test variable
Independent variable or grouping variable
Common Uses
The One Sample t Test is commonly used to test the following:
Statistical differences between the means of two groups
Statistical differences between the means of two interventions
Statistical differences between the means of two change scores
Note: The Independent Samples t Test can only compare the means for two (and
only two) groups. It cannot make comparisons among more than two groups. If
you wish to compare the means across more than two groups, you will likely want
to run an ANOVA.
Data Requirements
Your data must meet the following requirements:
1. Dependent variable that is continuous (i.e., interval or ratio level)
2. Independent variable that is categorical (i.e., two or more groups)
3. Cases that have values on both the dependent and independent variables
4. Independent samples/groups (i.e., independence of observations)
There is no relationship between the subjects in each sample. This means that:
Subjects in the first group cannot also be in the second group
No subject in either group can influence subjects in the other group
No group can influence the other group
Violation of this assumption will yield an inaccurate p value
5. Random sample of data from the population
6. Normal distribution (approximately) of the dependent variable for each group
Non-normal population distributions, especially those that are thick-tailed or
heavily skewed, considerably reduce the power of the test
Among moderate or large samples, a violation of normality may still yield
accurate p values
7. Homogeneity of variances (i.e., variances approximately equal across groups).
When this assumption is violated and the sample sizes for each group differ,
the p value is not trustworthy. However, the Independent Samples t Test output
also includes an approximate t statistic that is not based on assuming equal
population variances; this alternative statistic, called the Welch t Test statistic1,
may be used when equal variances among populations cannot be assumed. The
Welch t Test is also known an Unequal Variance T Test or Separate Variances
T Test.
8. No outliers
Note: When one or more of the assumptions for the Independent Samples t Test
are not met, you may want to run the nonparametric Mann-Whitney U Test
instead.
Researchers often follow several rules of thumb:
Each group should have at least 6 subjects, ideally more. Inferences for the
population will be more tenuous with too few subjects.
Roughly balanced design (i.e., same number of subjects in each group) are
ideal. Extremely unbalanced designs increase the possibility that violating any
of the requirements/assumptions will threaten the validity of the Independent
Samples t Test.
Hypotheses
The null hypothesis (H0) and alternative hypothesis (H1) of the Independent
Samples t Test can be expressed in two different but equivalent ways:
H0: µ1 = µ2 ("the two population means are equal")
H1: µ1 ≠ µ2 ("the two population means are not equal")
where µ is a constant proposed for the population mean and x is the sample
mean.
where µ1 and µ2 are the population means for group 1 and group 2, respectively.
Notice that the second set of hypotheses can be derived from the first set by simply
subtracting µ2 from both sides of the equation.
Levene’s Test for Equality of Variances
Recall that the Independent Samples t Test requires the assumption of
homogeneity of variance -- i.e., both groups have the same variance. SPSS
conveniently includes a test for the homogeneity of variance, called Levene's Test,
whenever you run an independent samples T test.
The hypotheses for Levene’s test are:
H0: σ12 - σ22 = 0 ("the population variances of group 1 and 2 are equal")
H1: σ12 - σ22 ≠ 0 ("the population variances of group 1 and 2 are not equal")
This implies that if we reject the null hypothesis of Levene's Test, it suggests that
the variances of the two groups are not equal; i.e., that the homogeneity of
variances assumption is violated.
The output in the Independent Samples Test table includes two rows: Equal
variances assumed and Equal variances not assumed.
If Levene’s test indicates that the variances are equal across the two groups
(i.e., p-value large), you will rely on the first row of output, Equal
variances assumed, when you look at the results for the actual Independent
Samples t Test (under t-test for Equality of Means).
If Levene’s test indicates that the variances are not equal across the two
groups (i.e., p-value small), you will need to rely on the second row of
output, Equal variances not assumed, when you look at the results of the
Independent Samples t Test (under the heading t-test for Equality of
Means).
The difference between these two rows of output lies in the way the independent
samples t test statistic is calculated. When equal variances are assumed, the
calculation uses pooled variances; when equal variances cannot be assumed, the
calculation utilizes un-pooled variances and a correction to the degrees of freedom.
Results interpretation
The table provides basic information about the group comparisons, including the
sample size (n), mean, standard deviation, and standard error for mile times by group.
In this example, there are 166 athletes and 226 non-athletes. The mean mile time for
athletes is 6 minutes 51 seconds, and the mean mile time for non-athletes is 9 minutes
6 seconds.
(A) Levene's Test for Equality of of Variances: This section has the test results for
Levene's Test. From left to right:
F is the test statistic of Levene's test
Sig. is the p-value corresponding to this test statistic.
The p-value of Levene's test is printed as ".000" (but should be read as p < 0.001 --
i.e., p very small), so we we reject the null of Levene's test and conclude that the
variance in mile time of athletes is significantly different than that of non-
athletes. This tells us that we should look at the "Equal variances not assumed"
row for the t test (and corresponding confidence interval) results. (If this test result
had not been significant -- that is, if we had observed p > α -- then we would have
used the "Equal variances assumed" output.)
(B) t-test for Equality of Means provides the results for the actual Independent
Samples t Test. From left to right:
t is the computed test statistic
df is the degrees of freedom
Sig (2-tailed) is the p-value corresponding to the given test statistic and
degrees of freedom
Mean Difference is the difference between the sample means; it also
corresponds to the numerator of the test statistic
Std. Error Difference is the standard error; it also corresponds to the
denominator of the test statistic
Note that the mean difference is calculated by subtracting the mean of the second
group from the mean of the first group. In this example, the mean mile time for
athletes was subtracted from the mean mile time for non-athletes (9:06 minus 6:51
= 02:14). The sign of the mean difference corresponds to the sign of the t value.
The positive t value in this example indicates that the mean mile time for the first
group, non-athletes, is significantly greater than the mean for the second group,
athletes.
The associated p value is printed as ".000"; double-clicking on the p-value will
reveal the un-rounded number. SPSS rounds p-values to three decimal places, so
any p-value too small to round up to .001 will print as .000. (In this particular
examples, the p-values are on the order of 10-40.)
(C) Confidence Interval of the Difference: This part of the t-test output
complements the significance test results. Typically, if the CI for the mean
difference contains 0, the results are not significant at the chosen significance
level. In this example, the 95% CI is [01:57, 02:32], which does not contain
zero; this agrees with the small p-value of the significance test.
So, since p < .001 is less than our chosen significance level α = 0.05, we can reject
the null hypothesis, and conclude that the that the mean mile time for athletes and
non-athletes is significantly different. Based on the results, we can state the
following:
There was a significant difference in mean mile time between non-
athletes and athletes (t315.846 = 15.047, p < .001).
The average mile time for athletes was 2 minutes and 14 seconds faster
than the average mile time for non-athletes.
Paired sample t test
Overview
The Paired Samples t Test compares two means that are from the same individual,
object, or related units. The two means typically represent two different times
(e.g., pre-test and post-test with an intervention between the two time points) or
two different but related conditions or units (e.g., left and right ears, twins). The
purpose of the test is to determine whether there is statistical evidence that the
mean difference between paired observations on a particular outcome is
significantly different from zero. The Paired Samples t Test is a parametric test.
This test is also known as:
Dependent t Test
Paired t Test
Repeated Measures t Test
The variable used in this test is known as: Dependent variable, or test variable
(continuous), measured at two different times or for two related conditions or
units.
Common Uses
The Paired Samples t Test is commonly used to test the following:
Statistical difference between two time points
Statistical difference between two conditions
Statistical difference between two measurements
Statistical difference between a matched pair
Note: The Paired Samples t Test can only compare the means for two (and only
two) related (paired) units on a continuous outcome that is normally distributed.
The Paired Samples t Test is not appropriate for analyses involving the following:
1) unpaired data; 2) comparisons between more than two units/groups; 3) a
continuous outcome that is not normally distributed; and 4) an ordinal/ranked
outcome.
To compare unpaired means between two groups on a continuous outcome that
is normally distributed, choose the Independent Samples t Test.
To compare unpaired means between more than two groups on a continuous
outcome that is normally distributed, choose ANOVA.
To compare paired means for continuous data that are not normally distributed,
choose the nonparametric Wilcoxon Signed-Ranks Test.
To compare paired means for ranked data, choose the nonparametric Wilcoxon
Signed-Ranks Test.
Data Requirements
Your data must meet the following requirements:
1. Dependent variable that is continuous (i.e., interval or ratio level)
Note: The paired measurements must be recorded in two separate variables.
2. Related samples/groups (i.e., dependent observations)
The subjects in each sample, or group, are the same. This means that the
subjects in the first group are also in the second group.
3. Random sample of data from the population
4. Normal distribution (approximately) of the difference between the paired
values
5. No outliers in the difference between the two related groups)
Note: When testing assumptions related to normality and outliers, you must use a
variable that represents the difference between the paired values - not the original
variables themselves.
When one or more of the assumptions for the Paired Samples t Test are not met,
you may want to run the nonparametric Wilcoxon Signed-Ranks Test instead.
Hypotheses
The hypotheses can be expressed in two different ways that express the same idea
and are mathematically equivalent:
H0: µ1 = µ2 ("the paired population means are equal")
H1: µ1 ≠ µ2 ("the paired population means are not equal")
where µ1 is the population mean of variable 1, and µ2 is the population mean of
variable 2..
Results interpretation
This table gives univariate descriptive statistics (mean, sample size, standard
deviation, and standard error) for each variable entered. Notice that the sample size
here is 398; this is because the paired t-test can only use cases that have non-missing
values for both variables.
Paired Samples Correlations shows the bivariate Pearson correlation coefficient (with
a two-tailed test of significance) for each pair of variables entered. The Paired
Samples Correlation table adds the information that English and Math scores are
significantly positively correlated (r = .243).
Note: Why does SPSS report the correlation between the two variables when you run
a Paired t Test? Although our primary interest when we run a Paired t Test is finding
out if the means of the two variables are significantly different, it's also important to
consider how strongly the two variables are associated with one another, especially
when the variables being compared are pre-test/post-test measures.
From left to right:
First column: The pair of variables being tested, and the order the subtraction
was carried out. (If you have specified more than one variable pair, this table
will have multiple rows.)
Mean: The average difference between the two variables.
Standard deviation: The standard deviation of the difference scores.
Standard error mean: The standard error (standard deviation divided by the
square root of the sample size). Used in computing both the test statistic and
the upper and lower bounds of the confidence interval.
t: The test statistic (denoted t) for the paired T test.
df: The degrees of freedom for this test.
Sig. (2-tailed): The p-value corresponding to the given test statistic t with
degrees of freedom df.
So, from the results, we can say that:
English and Math scores were weakly and positively correlated (r = 0.243,
p < 0.001).
There was a significant average difference between English and Math
scores (t397 = 36.313, p < 0.001).
On average, English scores were 17.3 points higher than Math scores
(95% CI [16.36, 18.23]).