Two-sample t Test

The two-sample t-test is used to test whether two samples come from distributions with the same means. The samples are assumed to come from Gaussian (normal) distributions. If this is not the case, then a nonparametric test, such as the Wilcoxon rank sum test, may be a more appropriate test of location.

This test handles both paired and independent samples.

To perform a two-sample t test

Choose Statistics ../__image/arrow5.gif Compare Samples ../__image/arrow5.gif Two Samples ../__image/arrow5.gif t test. The dialog shown below appears.

__image\t2samp.gif

The two-sample t-test dialog has the following options:

Data

Data Set

Select a data set from the dropdown list or type the name of a data set. You can also type into the Data Set edit field any expression that evaluates to a data set.

Variable 1

Specify a column as the first sample, when the data set does not have a grouping indicator.

Variable 2

Specify another column as the second sample, when the data set does not have a grouping indicator.

Variable 2 is a Grouping Variable

Select if one column in the data set is a grouping indicator that categorizes cases into two groups. In this case, select the response from Variable 1 and the indicator from Variable 2.

Test

Type of t Test

Choose Paired t for a paired t test; choose Two-sample t for an unpaired t test.

Assume Equal Variances

This is enabled only when Two sample t is chosen. Select if the two samples are assumed to come from populations with equal variances.

Hypotheses

Mean Under Null Hypothesis

Enter the difference between the assumed population means of Variable x and Variable y.

Alternative Hypothesis

Specify the alternative hypothesis. For example, to perform a one-sided test against the alternative hypothesis that the mean of Variable 1 is greater than the mean of Variable 2, select greater from the list box.

Confidence Interval

Confidence Level

Enter a number between 0 and 1 to be used as the confidence level.

Results

Save As

Enter the name for the object in which to save the results of the analysis.

Print Results

Select this to print out the results of the analysis in the designated output window.

Related S-PLUS language functions

t.test