After you import your data, but before
you run your hypothesis tests, you should
explore your data. When you have
categorical variables, you want to know
if you have any missing data. You want to
see frequencies, percentages, and get a
picture of how those data look. We are
going to dive deeper into exploring and
summarizing categorical data with SPSS.
In the history of statistics, we learned
that there are four levels of
measurement: nominal, ordinal, interval, and
ratio. You are already familiar with the
icons that IBM SPSS Statistics software
uses to indicate the levels of
measurement, such as the three dots for
nominal, the three bars for ordinal, and
the ruler for scale variables. Although
we can distinguish between interval and
ratio data, we don't need to for most
purposes. So SPSS treats interval and
ratio data as the same and it calls them
"Scale" level data. You may not be familiar
with less commonly used icons, such as
the small "a" in a circle to indicate a
string variable, for either ordered or
unordered categories. If you have set
your variable to be a date, you will see
the calendar added to the variable
measure. And if you are using a time
measure, you will see the clock. Now, that
looks like a lot of options... and it is, so
how can we simplify this complexity to
the fundamental differences that we need
to understand? Here is how to think about
variables. As you're learning or
exploring a variable, begin by asking
whether it is creating a category or
whether it is measuring something.
Nominal and ordinal data create
categories. Scale data measure something.
Let's practice by exploring a data set
that you are not yet familiar with. This
is the demo.sav data set supplied by IBM
with your IBM SPSS Statistics software.
If you need help finding and opening
this data set, you can follow the links
in the description for a video about
where to find it and how to open it.
In Variable View, we see the variable names,
labels, and levels of measurement.
Let's see what we have:
"Age in years"... is "time" a category or is it
measuring something? It is measuring
something - your actual age rounded down
in years. "Years" is a continuous
measurement, and it is scale. What about
marital status: married versus unmarried?
Are those categories or measurements?
Marital status is a category: are you in
the category of "people who are married"
or in the category of "people who are not
married"? We are not measuring HOW married
you are, just which category you fit in.
What are other categories? Here we have
"income measured in thousands", but this is
"income category". Any guess to which of
these variables is the categorical
variable? It is, of course, income category.
The raw data were exactly the same, but
in one case, we have a measurement of
income in thousands, and in another case
we have the same income data organized
into bands, or categories, of income.
Are you retired? That is a category: yes or no.
How many years have you been with your
current employer? That is measuring
something: years. Job satisfaction might
be measuring something if it's from a
validated tool like the Job Satisfaction
Survey, but when we look closer we see
that it is actually five categories from
"highly satisfied" to "highly dissatisfied".
So it is really categorical. How many
people you live with is a number, so it's
measuring something. Whether or not you
have voicemail, call-waiting, own a TV,
or a VCR, or a PDA: those are all
categories of yes and no.
As you can see, the first step of data
exploration is to make sure that the
levels are correctly set. In this case,
much of the categorical data has been
misidentified as scale. We can change
those.
Categorical variables have a limited
number of distinct categories. So, for
example, gender, race, type of diagnosis,
type of religion, or political party
affiliation. Categorical variables can be
numeric,
such as coding 0 for unmarried and
1 for married, or they can be string
data, such as coding M for male and F for
female. Categorical data are also
referred to as "qualitative data". Once you
have your categorical variables,
you should then consider whether those
categories are ordered or unordered.
Now, some categories do not have an inherent
order, or they are all at the same level.
So, for instance, if you were on the red
team or the blue team; you were assigned
to the experimental or the control group;
you are married or single; male/female;
racial categories; received Drug A or
Drug B: these are all examples of
unordered groups. So for unordered
categories, we want to know (1) what are
the categories, and (2) how many people
are in each category? This is all nominal
data.
Now, other categories have an underlying
order, or a meaningful ranking. So, for
example, freshmen are earlier in their
academic career than seniors. Job
experience could include apprentice,
journeyman, and master. Academics can be
tenured, associate professor, full
professor. Job skill can be identified as
low, medium, or high. Drug dosage could be
low, medium, or high. Symptoms could be
mild, moderate, or severe. Data at this
level are placed in some order. ost
often, this order is a ranking of the
data from highest to lowest; best to
worst; but the distance between the
values cannot be calculated. This is
Ordinal data. For categorical data,
the most typical summary measure is the
number or percentage of cases in each
category. For the unordered categories, or
the nominal data, use the mode as your
measure of central tendency and the
range if you need a measure of
variability. Use a bar chart for a graph.
For the ordered categories, or the
ordinal data, you can use the mode if the
number of categories is small - say up to
five. You could use the median - the value
at which half of the cases fall above or
below - if there are a large number of
ordered categories. Ordinal data may be
displayed with a bar chart ,or with a
histogram. All of these are nominal data.
Do you belong in the category of "I own a
PDA" or do you not? So as you've probably
figured out this is an old data set.
I like to think of it as "retro data". People
were asked whether they own a VCR, or a
CD player, or a PDA. I love it! In case
you're too young to remember, long before
we had these (cell phone), we used to keep track of
our calendars on one of these: a personal
digital assistant.
And instead of text messages, we had
pagers... and fax machines... and we got our
news from newspapers... and we liked it!
Let's analyze these data. Go to Analyze ->
-> Descriptive Statistics -> Frequencies
Drag all three of these variables into
the variables box and click OK. We see a
frequency table for each variable.
The frequency table reveals that only
20.4 percent of people own a PDA,
but almost everyone owns a VCR, and a CD
player. If we were doing a similar study
today, we might ask how many people own a
smartphone or how many own a 3D printer.
Let's dive deeper. Click on the Dialog
Recall button to bring up the
Frequencies dialog box again. We need
some charts. Click on Charts. Charts for
nominal categorical data could be a bar
graph, or a pie chart. Although if you use
pie charts, people will laugh at you for
not knowing that pie charts are a
horrible way to display data... so please
don't use pie charts. Instead, select bar
charts. We use a bar chart for nominal
data because the categories are
disconnected, just like the bars in a bar
chart do not touch. Think of a bar chart
and prison bars: the bars have a gap in
between. If the bars touch, then that
would be a histogram. Let's also get some
statistics ,although this is typically
not necessary. Let's get the mode, the
minimum, and the maximum. Click Continue,
and then OK. In the output window we can
check to see if we have missing values
and how many. This is a nice, clean data
set, so there are no missing values. We
see the frequency tables for each
variable, and we see the bar chart for
each of our variables.
The taller the bars, the more people own
a VCR, or a CD player... and not many people
own a PDA... it's too bad. So what do I mean
that the data response options are
"disconnected"?
Consider that if we were to switch the
yes and no columns in a bar chart, we
would still get exactly the same
information from the bar chart. Now, let's
explore our ordered categorical
variables. For our ordinal data, click on
the Dialog Recall button to bring up the
Frequencies dialog box again. Clear the
previous analysis by clicking Reset. Now,
move over some ordinal variables, like
"income category", "primary vehicle price
category" and "job satisfaction", which is
labeled as scale, but we actually know
it's an ordered category. For the
statistics, get the median, and also the
minimum, and maximum. Click Continue.
For charts, we will use a histogram, but these
are categorical data so we do not need
the normal curve. Click Continue.
Format is where we could sort the values
ascending, or descending; by values, or by
counts. We will leave the settings sorted
by ascending values. The settings for
style can also be left at their default
settings. Click OK. Notice how some of the
income categories are ordered categories
and they need to stay in the correct
order. It would not make sense to arrange
them in order of magnitude.
Job satisfaction should be ordered from
least to greatest, but notice how the
vehicle price is economy, standard, luxury.
I would treat those as three categories
without ordering them. As you can see,
when you examine the data, you may make
different choices about how you
ultimately want to display them. You can
use these same techniques with scale
level data, if you want to.
Use the Menu Recall to bring back the
Frequencies command box. I want to show
you both "income" and "income category".
Move over income. I would like to have these
variables next to each other, but income
category is at the top. No problem, I can
drag it and drop it down below.
Now click OK. Now, here we have this huge,
unmanageable frequency table, which is
why I don't use frequency tables with
scale data.; only categorical data.
Keep scrolling... keep scrolling... notice two very
different pictures when we get from the
income categories to the actual income.
This is an important point. The picture
that we get from the actual data shows
us the distribution. That distribution
can be altered, sometimes by nefarious
characters trying to mislead us with
statistics by skillfully manipulating
the size of the bars and the category
bands. Always honestly display your data.
Here's one more thing: we can also use
categorical variables along with scale
level variables. So, for instance, we could
create a bar chart for average income
for different levels of job satisfaction.
Go to Analyze -> Compare Means -> Means
Move over income and car category.
Now click OK. We see that the average income
for people who drive economy cars is
twenty one thousand eight hundred.
For standard, it is forty two thousand five
hundred, and for luxury, it is one hundred
and thirty four thousand six hundred.
No surprise there.
Notice to that jump from $21K to $42K,
and then a massive jump to $134K.
That shows how skewed the data can
become by a very few large outliers.
The privileged few people with really large
incomes can exert tremendous leverage on
the mean. That leverage can be disguised
by hiding those people in an open-ended
top category in a bar chart. If you are
exploring nominal data with unordered
categories, use the Frequencies command,
get a bar chart, and a frequency table.
The mode is the most useful measure of
central tendency. If you are exploring
ordinal data, with ordered categories, use
the Frequencies command. Ordinal data are
often better displayed with a histogram,
to indicate the connected nature of the
ordered categories. Regardless, you should
explore your data before you use it and
you should always strive to display your
data honestly, so that we can all learn
something from it.