When do we use Two-Sample T-Test?
Two-Sample T-Test is also known as independent T-Test or between-subjects T-test. We perform this test when we want to compare the mean of two different samples.
Comparing the mean scores in a statistics test between psychology students and law students
In this example, our null hypothesis is that there is no difference between the mean score of psychology students and law students. Our althernative hypothesis is that there is difference between the mean score of psychology students and law students. The dataset can be obtained here.
In the data, the first column is test scores for all students and the second column is the grouping variables. Here, 'p' is for student doing psychology and 'l' is for law students.
Select "Analyze -> Compare Means -> Independent-Samples T Test".
A new window pops out.
From the list on the left, select the variable "Test_scores" as "Test Variable(s)" and the variable "Students" as the grouping variable.
After you select the grouping variable, click "Define Groups" A new window pops out. Enter 'p' as Group 1 and 'l' as Group 2.
Click "Continue". The window now disappears. Now click "OK".
The results now pop out in the "Output" window.
We can now interpret the result.
Here, you see there are two results from two different t-tests, one assumed equal variance and the other unequal variance. Which result to use depends on the result from Levene's test. Since from A, the p-value of Levene's test is 0.591, we can assume that the variance of two groups are the same. (If the p-value of Levene's test is less than 0.05, we have to use the "Unequal variance" result) From B, since the p-value is 0.001, we reject the null hypothesis and conclude that there is difference between the mean score of psychology students and law students at 5% significance level.