Now that we have practiced doing a one-sample t-test by hand, we're going to
do that same one-sample t-test in SPSS. If SPSS is not already open on your
computer, open it now. We're going to import our data from sheet 2 of an Excel
spreadsheet that we created in the last video. This example will work, even if you
do not have the Excel file that I mentioned; you can create it along the
way. This is sheet 2 of the Martha Stewart ".xls" Excel spreadsheet that we're
going to import into SPSS. We can see that the variable name is men and that
we have nine scores for each of the men who participated in this test. If you do
not have this Excel spreadsheet, stop the video now, and enter the data that you
see here. Put the data on sheet 2 so that you can more easily follow the
directions as I explain them. Save the Excel file to your desktop. Before we
import this Excel data into SPSS, let me remind you of two important points. First,
the Excel spreadsheet must be closed in Excel. This process will not work if the
spreadsheet is still being used by Excel. Second, you should have saved the Excel
file to your desktop, so you must navigate to the desktop in order to be
able to see the file. Once you have SPSS open on your desktop, you can open the
Excel file using the commands File > Open > Data. Navigate to the desktop to view the
file. You will immediately notice that although you are looking at the desktop,
you do not see the Excel file, and that is because SPSS is currently looking for
files of type ".sav". Those are SPSS files. We need to change our files of
type to Excel. Now we see the Martha Stewart data set on the desktop. Click open.
By default, SPSS will read the variable names from the first row of data and
this is exactly what we want. We have already named our variable "men" and also
by default, SPSS will look at the first sheet of the Excel spreadsheet, however,
do you remember what sheet we put our data on? Sheet 2, so we need to change the
worksheet to sheet 2 in order to open these data. Click OK and there are our
data. Alternatively, if your version of SPSS has this option, you can save a step
when you open a file using the command File > Import Data > Excel. Select the same
file on the desktop. Choose sheet 2, and click OK. These techniques for opening a
file from Excel work exactly the same in SPSS. We can see in variable view that
"men" is a numeric variable. It does not have a label yet, but we know that these
are scale data. Change the measure to scale if necessary. Now we are ready to
do our one sample t-test in SPSS, but first, let's walk through the five steps
of hypothesis testing again so that we know what we are doing with this test.
Step one: select the appropriate statistic. The appropriate statistic for
comparing a sample mean to a known population value when the population
standard deviation is unknown, is the one sample t-test. Step two: State the null
and alternative hypotheses. We want to know if the mean for men is different
than the mean for women, so this is a non directional two-tailed test. The null and
alternative hypotheses are going to be exactly the same as when we did this by
hand. The null hypothesis is H Sub Zero : mu equals 73, where 73 is the mean of the
population. The alternative hypothesis is H sub 1 colon mu does not equal 73. Step
three: Select a level of significance. For selecting our level of significance, we
will be using a two-tailed test, because we are not establishing a direction that
the dependent variable will change. For most research the level of significance
will be alpha = 0.05. Technically you could set alpha equal to any value
that you desired, but for scientific research you really have only two
choices, alpha = .05 and alpha equals .01. Unless the problem says
otherwise, assume that the alpha is .05 two-tailed
test. The degrees of freedom always equals n - 1, where n is the number
of participants in your sample, in this case with nine men, our degrees of
freedom are eight. To find the critical value, we go to student's t-distribution
table. We are using a two-tailed test, so we
focus on the columns on the left. The alpha level is .05 with
8 degrees of freedom, so the critical value is positive or negative 2.306.
Alternatively, you can download the our stats effect size
calculator for T tests, and use it to determine your critical value. So here
you see six things that you can do with this effect size calculator spreadsheet.
If you click on the salmon-colored tab you will see a full t table of critical
values for two-tailed tests, complete with a picture of William Sealy Gosset
are old friends student. So we could use this table find our alpha level and
degrees of freedom and determine our critical value, but there is something
else that I want to show you. Click on the green tab labeled "critical values" in
the upper left, we have the typical setup for alpha equals .05 two-tailed tests.
Simply enter your degrees of freedom, click or hit return, and your critical
value 2.306 appears here. But wait, there's more! If you are
not doing a typical two-tailed alpha of .05 t-test, enter your degrees of
freedom here. Click, and you'll get the critical values for both one and two
tailed tests at a variety of alpha levels, and I will tell you more about
this green box in a moment. So any values exceeding + or - 2.306
indicate that the sample of men is statistically significantly
different than the population value, the comparison mean for women.
Step four: Calculate the statistics. Let's go back to SPSS.
We will conduct a one sample t-test on these data by going to analyze > compare
means > one sample t-test. The only variable that we have available is men.
So move men into test variables window. Now here's something very important. We
have to tell SPSS what is our comparison value, in this case the comparison value
is the mean of the population, which we have already established is 73, the mean
for women. Enter 73 into test value. Again, 73 is the mean of the population, or the
comparison value. Think for a moment about your null hypothesis. We are saying
that this sample is drawn from a population that has a mean of 73. I say
that this is very important, because if you do not enter a number for test value
in this box, then the comparison value by default will be zero, and if you compare
to a value of zero, typically you will get the wrong answer. So click "OK" and the
output window will pop up. Let's look at this output more closely. In the output
window, we see a box labeled one-sample statistics. In this box, we see the sample
size 9, the mean 66.56, the standard deviation 5.981, and the
standard error of the mean. We will use these for the APA write-up. Hopefully you
remember calculating the standard deviation and standard error of the mean
when we conducted our one sample t-test, by hand, if so you will recognize this
1.99 as the estimated standard error of the mean.
Scroll down a little to the one sample test box. So how can we interpret these
findings? First, the t-test value is a negative 3.232. In
this case, the negative value for T means that our sample mean is less than our
comparison value of 73. You interpret a positive T value and a negative T value
exactly the same way, the sign only indicates whether your sample was larger
or smaller than the comparison value. We have seen this T value before when we
did the test by hand. SPSS is calculating exactly the same value. The t value of
-3.232 exceeds the critical value of
-2.306. degrees of freedom is 8. We can see that the
significance value for this T test is .012, which is less than
.05, and we also see that the 95% confidence interval for the
difference between sample means, which is (mean one - mean two) shows a lower
bound of -11.04, and an upper bound of -1.85.
Because this confidence interval does not cross zero, it does not
include the hypothesized null value of zero difference. Then we can conclude
that the groups are in fact different. All of these findings tell us exactly
the same thing, there is a statistically significant difference between these two
means. Let's go back to our five steps of hypothesis testing.
Step four: Calculate the statistics. The t-test value is a -3.232.
We will round that to -3.23. The
critical value was positive negative 2.306. The obtained t
value of -3.23 exceeds the critical value. That means
that the t-test was statistically significant, and the sample mean differs
from the population mean. We reject the null hypothesis that says there is no
difference between the sample and the population. Finally step 5:
Make the decision. Men scored significantly lower than women on a test
of indoor gardening. T with 8 degrees of freedom equals -3.23.
Probability equals .012. but before we do the write-up, we
also need to calculate the effect size.
To calculate Cohen's D effect size, we will use the Rstats effect size
calculator for T tests. We are calculating a Cohen's D for single
sample t-tests, so click on the light purple tab for "effect single sample." You
have two options here, option one is to enter the sample mean 66.56,
the population mean 73, and the standard deviationb 5.98,
which you calculated as part of doing the test earlier. Click, and the Cohen's D
is a -1.076. Now option two requires output from SPSS.
Here in the output window, double-click on the one sample test box to activate
it. Here we need the T value and the degrees of freedom. Highlight, copy, and
then flip back to the Rstats effect size calculated for T tests. Paste the
output and click. You can see that the numbers are slightly different, but they
both round up to -1.08, so that is what we will report. We
interpret a negative effect size exactly the same way that we interpret a
positive effect size, just as we interpret a negative T value the same
way we interpret a positive T value. The negative sign just tells us that the
sample mean was lower than the population mean, if the sample mean had
been larger than the population mean. Both the effect size and the T value
would be positive. Regardless, the actual effect was still the same size, and
here's how we would write up those results in APA style. "A one-sample T test
was conducted to determine whether men scored differently than women on a test
of indoor gardening. The mean scores for men were significantly lower than for
women, t(8) =-3.23,
p = .012, Cohen's D = -1.08,
with a 95% confidence interval between - 11.04 and - 1.85. This
suggests a gender difference in gardening skills.
Notice that the T value, the P, and Cohen's D are all italicized, and the
degrees of freedom, 8, is in parentheses I change the color of the p value here to
stress the difference between the write-up that we did by hand using p < .05,
and the write-up from SPSS, which reports the actual probability. That last
statement about gender difference would go in your discussion section if you are
writing this up for a paper.