-
So here we are in SPSS
-
I have created kind of a
-
a junk data set
-
just to help illustrate
-
how we can compute variables
-
or compute new variables
-
using the values from existing ones.
-
This is a pretty straight forward process,
-
it looks a little bit different
-
than things that we've done before
-
or other ways that we are going
-
to be using an SPSS in this course.
-
So it might look a little bit different,
-
but it is pretty straight forward
-
and pretty easy
-
once you know how to do this.
-
So the first thing that we'll do
-
is to go to Transform and then
-
the first option we have there
-
is Compute Variable. So click on that.
-
We get this new window that pops up
-
The first thing that we really want
-
to look at is in the top left and
-
and that's this target variable window.
-
Basically what the computer
-
is asking you
-
is to create a name for the new variable
-
that you are going to be computing.
-
This name needs to be unique,
-
it's one that can't have spaces in it
-
and it should avoid special characters.
-
But
-
in this case, what I like
-
to do is include some sort of piece
-
of information in there
-
in the naming convention I use
-
that helps me know what this is
-
just by looking at it.
-
So what we're going to be doing
-
is we are going to be summing items
-
one, two, three, four, five, six together,
-
adding those together.
-
So an easy way to do that,
-
is just to put sum of items.
-
That way when I look at this new variable
-
once it's generated
-
I know that that's the variable
-
that I really want to be working with.
-
Or running my tests on because that
-
that contains the information
-
from the other ones.
-
You can click on type and label.
-
The label is the more
-
drawn out explanation,
-
that's the one you can include character
-
additional characters or spaces
-
and special characters.
-
In our case,
-
I'm going to put this is the sum
-
of items
-
one through six.
-
And that way, I know that
-
that is going to a
-
give me a more
-
drawn out explanation of what
-
this variable includes.
-
We know this is
-
going to be uneric - numeric - I'm sorry,
-
so click Continue.
-
The next thing we are going to
-
look at is this numeric expression box
-
Um we're actually come back
-
to this in just a minute.
-
But this is where you're going to be doing
-
most of the work
-
when you're computing a variable.
-
What you want to go to next
-
is this function group area.
-
So I'm going to click on All
-
and you notice right below it
-
we've got these functions
-
and special variables
-
and this pop up when I clicked on all.
-
This has a whole bunch
-
of different pre-existing functions,
-
so you don't need to reinvent the wheel.
-
You can basically use these pre-existing
-
functions to help you compute
-
this new variable.
-
Um, I'm going to go down to sum
-
and these are in alphabetical order
-
so it's pretty easy to find.
-
Here we have Sum and when I click on Sum,
-
you'll notice that this box to the left
-
populated with some text.
-
This box is actually pretty useful.
-
So the first thing it shows you
-
is an example of what this expression
-
is going to be.
-
I know expression
-
sounds likes a really fancy term,
-
if you've ever used a formula in Excel
-
it's basically that.
-
It's telling the computer
-
what it needs to do.
-
In this case, just like Excel,
-
we've got the word sum,
-
which tells the computer it's going
-
to be summing different values together.
-
And then in parenthesis,
-
immediately after that,
-
we have different variables
-
Not Synced
that are separated by a comma
-
Not Synced
and that's what tells the computer
-
Not Synced
to add x, y, and z things together
-
Not Synced
to create a new variable
-
Not Synced
or compute a new variable.
-
Not Synced
This also provides additional
-
Not Synced
extra content here, but we don't need to
-
Not Synced
worry about that. I've found this
-
Not Synced
is useful if you are stuck or something
-
Not Synced
isn't working right.
-
Not Synced
So we've got some selected,
-
Not Synced
we're going to be summing the items
-
Not Synced
of one, two, three, four, five, and six
-
Not Synced
together. We've got that selected.
-
Not Synced
So the next thing you do
-
Not Synced
is click this up arrow
-
Not Synced
which basically takes that pre-existing function
-
Not Synced
and kicks it up to this
-
Not Synced
numeric expression box.
-
Not Synced
The next thing that we're going to do,
-
Not Synced
we've already told the computer
-
Not Synced
that we're going to sum
-
Not Synced
different variables together,
-
Not Synced
We need to tell it which variables
-
Not Synced
to sum together.
-
Not Synced
So the easy way to do this
-
Not Synced
is to click on the first item
-
Not Synced
we want to include and you'll notice that
-
Not Synced
this arrow switched sides
-
Not Synced
from pointing to the left to pointing
-
Not Synced
to the right, click over one,
-
Not Synced
and we've already moved over item one.
-
Not Synced
What you need to be careful of
-
Not Synced
is that you always have a comma
-
Not Synced
after each variable except for the last one.
-
Not Synced
So a comma is already here,
-
Not Synced
but what I usually do is I just hit a comma
-
Not Synced
I go to item two, kick that over,
-
Not Synced
comma, item three, kick that over,
-
Not Synced
comma, item four, kick that over,
-
Not Synced
comma, item five, kick that over,
-
Not Synced
comma, item six, kick that over.
-
Not Synced
Now we know that item six
-
Not Synced
is the last one we have,
-
Not Synced
the last variable we're including.
-
Not Synced
So what' we're going to do is just delete
-
Not Synced
out that question mark, we're going to
-
Not Synced
delete out that last comma and
-
Not Synced
then if we read through this real quick
-
Not Synced
just to make sure we don't have any problems
-
Not Synced
we've got creating sum of items,
-
Not Synced
this is going to be the sum of item one,
-
Not Synced
two, three, four, five, and six
-
Not Synced
and what we're going to do now is click OK
-
Not Synced
An output window pops up and basically
-
Not Synced
tells you what the computer did
-
Not Synced
it computed the sums, which was the sum
-
Not Synced
of items one, two, three, four, five, and six
-
Not Synced
it gives us the variable label.
-
Not Synced
It gives us that descriptive text I put in
-
Not Synced
I'm just going to minimize this window
-
Not Synced
and if you look back here, you might
-
Not Synced
notice that there is this new column,
-
Not Synced
this new variable, this sum of items,
-
Not Synced
that wasn't there when we started
-
Not Synced
and that's because SPSS computed that
-
Not Synced
and if we add these together
-
Not Synced
if you add each row
-
Not Synced
you've got one two one three five one
-
Not Synced
that adds to thirteen.
-
Not Synced
Five one two three five one
-
Not Synced
adds to seventeen.
-
Not Synced
So it's done that math for us, you didn't
-
Not Synced
have to manually do it.
-
Not Synced
I know yes it would be pretty easy
-
Not Synced
to manually do this for ten cases
-
Not Synced
but if you have a data set
-
Not Synced
that has five hundred cases
-
Not Synced
that would be very time-consuming to do.
-
Not Synced
And you can see, that this kind of function,
-
Not Synced
of computing this variable, can save you
-
Not Synced
a lot of time. It's also more accurate
-
Not Synced
It's going to take any sort of error
-
Not Synced
out of the process, error out of the
-
Not Synced
equation. And we know that, often,
-
Not Synced
when we do things by hand,
-
Not Synced
we can introduce error into things.
-
Not Synced
So we want to avoid that.
-
Not Synced
That's one way to compute a variable.
-
Not Synced
I'm going to show you one other way
-
Not Synced
a different type of variable
-
Not Synced
that we can compute.
-
Not Synced
I'm going to go back to transform
-
Not Synced
I'm going to go back to compute variable
-
Not Synced
I'm actually going to clear this out
-
Not Synced
we're done with sum of items
-
Not Synced
we don't need to worry about it
-
Not Synced
we'renot going to use the same expression
-
Not Synced
so we click reset in the bottom here
-
Not Synced
so what I want to do is create the mean
-
Not Synced
of the different items that we have.
-
Not Synced
Sometimes if you are working
-
Not Synced
with a pre-existing scale
-
Not Synced
it might tell you to add all the items
-
Not Synced
together and then that's what represents
-
Not Synced
that theoretical concept or that measure.
-
Not Synced
Sometimes it might tell you to use the mean
-
Not Synced
so what I want to do is compute
-
Not Synced
both of these things. because they both
-
Not Synced
might be helpful to me.
-
Not Synced
So what I'm going to do,
-
Not Synced
is I'm going to type in mean of items
-
Not Synced
and again, that very quickly, let's me
-
Not Synced
differentiate between sum of items
-
Not Synced
and mean of items, type of label
-
Not Synced
again, I'm just going to put mean of items
-
Not Synced
one through six
-
Not Synced
Click continue
-
Not Synced
Just like we did before
-
Not Synced
click on all and then
-
Not Synced
we're going to go down to mean.
-
Not Synced
Here's mean.
-
Not Synced
And when I click on that, again,
-
Not Synced
it gives me that sample text here,
-
Not Synced
this is very similar to what we did before
-
Not Synced
I'm going to click up
-
Not Synced
and we're going to kick over one
-
Not Synced
comma two comma three comma four
-
Not Synced
comma five and then six.
-
Not Synced
I'm making sure to include this last one
-
Not Synced
this sum of items
-
Not Synced
and then just like last time,
-
Not Synced
we're going to delete out that question mark
-
Not Synced
that last comma
-
Not Synced
we're going to read through it
-
Not Synced
really quickly just to avoid an error
-
Not Synced
we've got a new variable, the mean of item
-
Not Synced
one two three four five and six
-
Not Synced
I'm going to click OK
-
Not Synced
SPSS again showed me the syntax of kind of
-
Not Synced
what it did. I'm going to minimize that.
-
Not Synced
And then here we have the mean of items.
-
Not Synced
And if we really quickly look at this
-
Not Synced
I'm gonna pick this one for example,
-
Not Synced
we've got one one three three one two
-
Not Synced
and a mean on 1.83 would just eyeballing it
-
Not Synced
kind of make sense.
-
Not Synced
If we look at this one, 3.67
-
Not Synced
Two three five four five three
-
Not Synced
that would roughly make sense
-
Not Synced
without having to do the math of it
-
Not Synced
but this is computed the average score
-
Not Synced
the mean score for all six of those items
-
Not Synced
and that is very quickly how to compute
-
Not Synced
a new variable in STSS
-
Not Synced
This is particularly useful when
-
Not Synced
you have collected data using a pre-existing
-
Not Synced
measure and that measure has instructed you
-
Not Synced
to compute the sum of items
-
Not Synced
and run your tests on that.
-
Not Synced
Or maybe the mean of items
-
Not Synced
and run your tests on that.
-
Not Synced
But this is a useful way of understanding
-
Not Synced
how to create new variables
-
Not Synced
using existing ones in SPSS.