Student Center
 For list of chapters click on arrow Chapter 1 : Introduction: The Science of Psychology Chapter 2 : The Research Process Chapter 3 : Ethical Issues in Psychological Research Chapter 4 : Observational Research Chapter 5 : Correlational Research: Surveys Chapter 6 : Experimental Research Designs Chapter 7 : Complex Designs Chapter 8 : Single-case Research Designs Chapter 9 : Quasi-experimental Designs and Program Evaluation Chapter 10 : Epilogue: How to be an Intelligent Consumer of Psychological Research Glossary Career Appendix for Psychology Students Statistics Primer SPSS Online Guide

SPSS Online Guide

| Welcome | The SPSS Program | Using SPSS for Windows to Compute a Correlation | Starting Up SPSS | Data Input for SPSS | Advanced Data Entry and File Handling | Computing the Pearson Correlation | The t-test with SPSS | Analysis of Variance with SPSS | The One-Way ANOVA with SPSS | Factorial ANOVA with SPSS | Chi-Square with SPSS | Transformations | Exploratory Data Analysis | Help Features | Reliability Analysis | Moving Output to Other Applications | Conclusion |

The t-test with SPSS

This page contains information on Independent Groups and Dependent Groups for 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:

 Participant Current GPA Weekly Study Time Sex Participant #01 1.8 15 hrs 2 Participant #02 3.9 38 hrs 1 Participant #03 2.1 10 hrs 2 Participant #04 2.8 24 hrs 1 Participant #05 3.3 36 hrs . Participant #06 3.1 15 hrs 2 Participant #07 4.0 45 hrs 1 Participant #08 3.4 28 hrs 1 Participant #09 3.3 35 hrs 1 Participant #10 2.2 10 hrs 2 Participant #11 2.5 6 hrs 2

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.

Back to the Top of the Page

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:

T-Test

Group Statistics

 Variable N Mean Std. Deviation Std. Error Mean SEX 1.00 Female 5 3.4800 .487 .218 2.00 Male 5 2.3400 .493 .220

Independent Samples Test

 Levene's Test for Equality of Variances F Sig. SEX Equal variances assumed .002 .962 Equal Variances not assumed

 t-test for Equality of Means t df Sig. (2-tailed) Mean Difference SEX Equal variances assumed 3.68 8 .021 .1750 Equal variances not assumed 3.68 8.00 .025 .1750

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:

Group Statistics

 Studyhours N Mean Std.Deviation Std. Error Mean COLGPA College GPA for Fall 1997 Studyhours >= 20.00 Studyhours < 20.00 6 5 3.4500 2.3400 .4416 .4930 .1803 .2205

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).

 Participant Colgpa1 Weekly Study Time Sex Colgpa2 Participant #01 1.8 15 hrs 2 . Participant #02 3.9 38 hrs 1 3.88 Participant #03 2.1 10 hrs 2 2.80 Participant #04 2.8 24 hrs 1 3.20 Participant #05 3.3 36 hrs . 3.60 Participant #06 3.1 15 hrs 2 3.57 Participant #07 4.0 45 hrs 1 4.00 Participant #08 3.4 28 hrs 1 3.35 Participant #09 3.3 35 hrs 1 3.66 Participant #10 2.2 10 hrs 2 2.55 Participant #11 2.5 6 hrs 2 2.67

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

 Mean N Std. Deviation Std. Error Mean Pair 1 Colgpa1 Colgpa2 3.0600 3.3280 10      10 .6552 .5091 .2072 .1610

Paired Samples Correlations

 N Correlation Sig. Pair 1   Colgpa1 - Colgpa2 10 .944 .000

Paired Samples Test

 Paired Differences t 95% Confidence Interval of the Difference Mean Std. Deviation Std. Error Mean Lower Upper Pair 1   Colgpa1 - Colgpa2 -.2680 .2419 7.649E-02 .4410 -9.50E-02 -3.504

Paired Samples Test

 df Sig. (2-tailed) Pair 1   Colgpa1 - Colgpa2 9 .007

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.

Back to the Top of the Page