The first step to doing a proper analysis in SPSS is having your
variables set up properly. We're going to begin with a blank data
set. Then we'll create five variables, and then we'll learn how different types of
numeric variables should be set up so that we can use them for calculating
statistics. I will begin by opening SPSS on my computer. If you're continuing from
the previous video, you will already have SPSS open. We see the splash page, I will
dismiss the opening dialog box, and we are ready to get started. This is a blank
SPSS data set. You can get a data set like this by opening SPSS, or by using
the drop down menu, file > new > data. By default, the data set opens in data view,
and we could begin entering data right now, but best practices are to define our
variables first, and then enter data. So let's go to variable view. Creating a new
variable in SPSS is incredibly easy. If you can type, you can create a variable.
In fact, that is how you create a variable, you type its name. In the first
row under name, type the word "subject" and then click return on Mac, or Enter on PC.
Congratulations! You have just created your first variable in SPSS. You can see
that by default, SPSS sets up your variable in a specific way, and you may
or may not be satisfied with these default settings. I'm never happy with
default settings. So let's change them a little. First, this variable is the
subject number, a random number to identify one person from another. These
will be whole numbers, no decimals. I want to set the decimals to zero.
To do this click next to the two. Some up and down arrows appear. I can add
decimals by clicking the up arrow, or I could click the down arrow, all the way
to zero. Next, I'm going to set the measure to nominal. A subject number is a
random number that fills in for a person's name. Anytime that a number
stands for a name or category, it is a nominal variable. Here is what you need
to know about variable names in SPSS. The variable name must begin with a letter.
You can use numbers in the name, but you cannot begin with them. Now there are
some exceptions to this rule, but they are advanced techniques that require
using syntax. Two - each variable name must be unique. You cannot have two variables
with the same name. Three, no spaces are allowed. If you enter a variable name
containing a space, you'll get an error message about the variable name
containing an illegal character. If you do, dismiss the error message and try
something else with your variable name. You can however use an underscore in
place of a space; just don't end your variable name with an underscore or a
period. That will cause conflicts later. Alternately you can use "camelcase" also
known as camel caps, or medial capitals. Camel case is where you type compound
words beginning each new word with a capital letter. And finally, the variable
name must be 64 characters or less, preferably a lot less. Keep your variable
names relatively short. Next, I am going to create a variable called "study". This
is going to be the hours spent studying by each person. To create this variable, I
type "study" and then return. Congratulations! You have just created
your second variable in SPSS. Again, hours spent studying will be an integer, a
whole number, so I set the decimals to zero. This time because time measured in
hours is a ratio scale, I'm going to set the measure to
scale. Here's a quick aside about levels of measurement - numbers can tell us three
things. Numbers can stand for names, and tell us which one, or what kind, so one
equals male and two equals female. These are nominal variables. Numbers can
represent an order, such as first place, second, third, etc., these are ordinal
variables. And finally, numbers can tell us about an amount, such as how many? Or
how much? These values always have equal intervals between them, but depending on
whether the numbers could allow for negative values, or if they have a true
zero we call them interval or ratio. In SPSS, both interval and ratio data, any
data that indicate an amount are called scale data. Next we are going to create a
variable called "test." This will be the students score on the first test. Type
test set the decimals to zero. Set the measure to scale. See, you're getting the
hang of this. Now create a variable called anxiety. This is going to be a
score on a measure of test anxiety. Leave the decimals set to two. Set the measure
to scale. Good, one more. The last variable that we need is gender. Set the decimals
to zero, and set the measure to nominal, because gender is a categorical variable
where numbers will stand in for male and female. Variable names are relatively
short and may not be very descriptive. Therefore it is useful to provide more
detailed labels for each of your variables. Variable labels can be pretty
much anything that you care to type. They can contain spaces, numbers, letters,
special characters, and they're incredibly useful.
I encourage you to always use labels for your variables. As a researcher, you will
create numerous datasets, and there is nothing more frustrating than going back
to some data you collected a year ago or more, and finding the variables named "q1,
q2, q3" or worse yet, they are 0001, with no indication of what they
mean. And even if you think that you remember what they mean, you can be wrong.
So if you use those variables for publication, you could be mistaken ,and
that leads to all kinds of trouble. So the solution is to always use labels.
Start by clicking in the blank space under label for the first variable
subject. Label the variables in order. "Subject" is random ID number. "Study" is hours
spent studying. "Test" - score on test one.
"Anxiety" - score on anxiety scale. "Gender" - gender, so yeah we really wouldn't need
to label gender because the name is self-explanatory,
but I want you to get in the habit of using labels. There is something else
about gender that we need to know. We are using numbers 1 & 2 to stand in for male
and female. We need to know who is who. For that, we use value labels. Some
variables, particularly nominal and ordinal level variables, will have
different levels or values attached to them. For instance, you might code males
as one, and females as two, or you might code freshmen as one, sophomores as two,
juniors as three, seniors as four. You can define these levels in the values column
in SPSS. Under values, click on the cell for gender
where it says "none". You will see an icon with three dots. Click it. This activates
the value labels dialog box. Here we can define one equals male, and two equals
female. Now of course we could make that one equals female, or use zero and one, so
zero equals female. Remember that these numbers are codes. They do not indicate
value or order. I recommend getting into a habit of coding, and then keeping it
consistent for you. So when I code gender, I always use one equals male, two equals
female in my data entry so I am consistent. If I'm coding an item that is
yes or no, I will use one equals yes zero equals no, and I'll do the same thing for
any variable where zero indicates absence of something or non-belonging to
the other category. On the other hand if I have variables like freshman, sophomore,
junior, senior, I would just use one, two, three, four. So now we have a data set
that is all set up and ready to use. All we need are some numbers.
Click on the tab data view at the bottom of the SPSS window. You'll be taken to
the data editor, in which you can enter numeric values for each variable. This is
data view with some data in it. You do not need to enter data right now, but I
want to show you one other trick. In the gender column, type some random one's and
two's. Doesn't matter which rows get which number, just put some in. Now click on the
value labels button. For all variables with codes, like gender, this button will
toggle back and forth between the numbers and the value labels. So here's
one more thing - go to analyze > descriptive statistics > frequencies. This is how we
would calculate some statistics. You can see that our variables are in this box,
and currently we see variable labels. Right-click on any
variable, and choose display variable names. Right-click again, and you can
toggle back and forth. This will be handy later on. Click cancel to close the
dialog box. You can save your data file by clicking "file" then "save." Save the file
to your desktop or to your personal file as "students" the suffix, .sav,
indicating an SPSS file, will be added automatically. If you are planning to use
R or Jasp, you would save your data as a .csv.