SPSS Online Guide
The t-test with SPSS
A Review of the t-test
The t-test is used for testing differences between two means. In order to use a t-test, the same variable must be measured in different groups, at different times, or in comparison to a known population mean. Comparing a sample mean to a known population is an unusual test that appears in statistics books as a transitional step in learning about the t-test. The more common applications of the t-test are testing the difference between independent groups or testing the difference between dependent groups.
A t-test for independent groups is useful when the same variable has been measured in two independent groups and the researcher wants to know whether the difference between group means is statistically significant. "Independent groups" means that the groups have different people in them and that the people in the different groups have not been matched or paired in any way. A t-test for related samples or a t-test for dependent means is the appropriate test when the same people have been measured or tested under two different conditions or when people are put into pairs by matching them on some other variable and then placing each member of the pair into one of two groups.
The t-test For Independent Groups on SPSS
A t-test for independent groups is useful when the researcher's goal is to compare the difference between means of two groups on the same variable. Groups may be formed in two different ways. First, a preexisting characteristic of the participants may be used to divide them into groups. For example, the researcher may wish to compare college GPAs of men and women. In this case, the grouping variable is biological sex and the two groups would consist of men versus women. Other preexisting characteristics that could be used as grouping variables include age (under 21 years vs. 21 years and older or some other reasonable division into two groups), athlete (plays collegiate varsity sport vs. does not play), type of student (undergraduate vs. graduate student), type of faculty member (tenured vs. nontenured), or any other variable for which it makes sense to have two categories. Another way to form groups is to randomly assign participants to one of two experimental conditions such as a group that listens to music versus a group that experiences a control condition. Regardless of how the groups are determined, one of the variables in the SPSS data file must contain the information needed to divide participants into the appropriate groups. SPSS has very flexible features for accomplishing this task.
Like all other statistical tests using SPSS, the process begins with data. Consider the fictional data on college GPA and weekly hours of studying used in the correlation example. First, let's add information about the biological sex of each participant to the data base. This requires a numerical code. For this example, let a "1" designate a female and a "2" designate a male. With the new variable added, the data would look like this:
With this information added to the file, two methods of dividing participants into groups can be illustrated. Note that Participant #05 has just a single dot in the column for sex. This is the standard way that SPSS indicates missing data. This is a common occurrence, especially in survey data, and SPSS has flexible options for handling this situation. Begin the analysis by entering the new data for sex. Use the arrow keys or mouse to move to the empty third column on the spreadsheet. Use the same technique as previously to enter the new data. When data is missing (such as Participant #5 in this example), hit the <ENTER> key when there is no data in the top line (you will need to <DELETE> the previous entry) and a single dot will appear in the variable column. Once the data is entered, click Data > Define Variable and type in the name of the variable, "Sex." Then go to "value" And type a "1" in the box. For "Value Label," type "Female." Then click on ADD. Repeat the sequence, typing "2" and "male" in the appropriate boxes. Then click ADD again. Finally, click CONTINUE >OK and you will be back to the main SPSS menu.
To request the t-test, click Statistics > Compare Means > Independent SamplesT Test. Use the right-pointing arrow to transfer COLGPA to the "Test Variable(s)" box. Then highlight Sex in the left box and click the bottom arrow (pointing right) to transfer sex to the "Grouping Variable" box. Then click Define Groups. Type "1" in the Group 1 box and type "2" in the Group 2 box. Then click Continue. Click Options and you will see the confidence interval or the method of handling missing data can be changed. Since the default options are just fine, click Continue > OK and the results will quickly appear in the output window. Results for the example are shown below:
Independent Samples Test
The output begins with the means and standard deviations for the two variables which is key information that will need to be included in any related research report. The "Mean Difference" statistic indicates the magnitude of the difference between means. When combined with the confidence interval for the difference, this information can make a valuable contribution to explaining the importance of the results. "Levene's Test for Equality of Variances" is a test of the homogeneity of variance assumption. When the value for F is large and the P-value is less than .05, this indicates that the variances are heterogeneous which violates a key assumption of the t-test. The next section of the output provides the actual t-test results in two formats. The first format for "Equal" variances is the standard t-test taught in introductory statistics. This is the test result that should be reported in a research report under most circumstances. The second format reports a t-test for "Unequal" variances. This is an alternative way of computing the t-test that accounts for heterogeneous variances and provides an accurate result even when the homogeneity assumption has been violated (as indicated by the Levene test). It is rare that one needs to consider using the "Unequal" variances format because, under most circumstances, even when the homogeneity assumption is violated, the results are practically indistinguishable. When the "Equal" variances and "Unequal" variances formats lead to different conclusions, seek consultation. The output for both formats shows the degrees of freedom (df) and probability (2-tailed significance). As in all statistical tests, the basic criterion for statistical significance is a "2-tailed significance" less than .05. The .006 probability in this example is clearly less than .05 so the difference is statistically significant.
A second method of performing an independent groups t-test with SPSS is to use a noncategorical variable to divide the test variable (college GPA in this example) into groups. For example, the group of participants could be divided into two groups by placing those with a high number of study hours per week in one group and a low number of study hours in the second group. Note that this approach would begin with exactly the same information that was used in the correlation example. However, converting the Studyhrs data to a categorical variable would cause some detailed information to be lost. For this reason, caution (and consultation) is needed before using this method. To request the analysis, click Statistics > Compare Means > Independent Samples T Test.... Colgpa will remain the "Test Variable(s)" so it can be left where it is. Alternately, other variables can be moved into this box. Click "Sex(1,2)" to highlight it and remove it from the "Grouping Variable" box by clicking the bottom arrow which now faces left because a variable in the box has been highlighted. Next, highlight "Studyhrs" and move it into the "Grouping Variable" box. Now click Define Groups... and click the Cut point button. Enter a value (20 in this case) into the box. All participants with values less than the cutpoint will be in one group and participants with values greater than or equal to the cutpoint will form the other group. Click Continue > OK and the output will quickly appear. The results from the example are shown below:
The "Group Statistics" table provides the means and standard deviations along with precise information regarding the formation of the groups. This can be very useful as a check to ensure that the cutpoint was selected properly and resulted in reasonably similar sample sizes for both groups. The remainder of the output is virtually the same as the previous example.
The t-test For Dependent Groups on SPSS
The t-test for dependent groups requires a different way of approaching the data. For this type of test, each case is assumed to have two measures of the same variable taken at different times. Each "Case" would therefore consist of a single person. This would be what is called a repeated measures design. Alternately, each case could contain the same information about two different individuals who have been paired or matched on a variable. In the repeated measures situation, one might collect GPA information at two different points in the careers of a group of students. The table below shows how this situation might appear in the fictional example. In this case, GPA data have been collected at the end of each participant's first year (Colgpa1) and senior year (Colgpa2).
One thing to note about the new data is that the GPA of the first participant is missing. Given the 1.8 GPA at the first assessment, it seemed reasonable that this person might not remain in college for the entire four years. This is a common hazard of repeated measures designs and the implication of such missing data needs to be considered before interpreting the results.
To request the analysis, click Statistics > Compare Means > Paired-Samples T Test .... A window will appear with a list of variables on the left and a box labeled "Paired Variables" on the right. Highlight two variables (Colgpa and Colgpa2, in this example) and transfer them to the "Paired Variables" box by clicking the right-pointing arrow between the boxes. Several pairs of variables can be entered at this time. The Options... button opens a window that allows control of the confidence interval and missing data options. Click Continue (if you opened the Options... window) > OK to complete the analysis. The output will appear in an Output window. Results for the example problem are shown below:
Paired Samples Statistics
Paired Samples Test
Paired Samples Test
The output is similar to the independent groups t-test. The first table of the output shows the means and standard deviations for the two groups and the second table shows the correlation between the paired variables. The next table shows the mean of the differences, standard deviation of the differences, standard error of the mean, the confidence interval for the difference, and the obtained value for t. The 2-tailed Sig[nificance] which is stated as a probability is shown in the last table. As usual, probabilities less than .05 indicate that the null hypothesis should be rejected. In this case, the interpretation would be that GPA increased significantly from firstyear to senior year, t(9) = 3.50, p = .007.