Types of Variables
This material is covered partially by Sall, Lehman and Creighton (2001) Chapters 1 and 2, by
Milton (1992) Chapters 1 and 4, by Sokal and Rohlf (1995) Chapters 1 and 2, by Koopmans
(1987), pp. 1-10, by Daniel (1987) 1.1-1.2, pp. 1-4, by Zar (2010) Chapter 1, and by Ott and
Longnecker (2001) Section 4.6. (See Bibliography).
Contents






Definition of variable
Type of variable determines method of analysis
o Counts, or counting variables
o Discrete vs. Continuous
o Continuous Variables and Rounding
Identification of variables
o Complete, One-Sentence Identification of the (Underlying) Random Variable of
←IMPORTANT
Importance of the Hierarchy
Exercise Set A
Exercise Set B
Definition: variable = characteristic
A variable is the mathematical model for a characteristic observed or measured in an
experiment, survey, or observational study.
Type of variable determines method of analysis
There are many different statistical methods, i.e., methods for analyzing the data of experiments
or surveys. It is important to be able to recognize different types of variables because the type of
variable determines which method of analysis is appropriate.
General type
Qualitative
(attribute, categorical, classification)
Quantitative
(measurement)
Most detailed "type"
hierarchy
Nominal
Ordinal
Interval
Interval
Discrete
Continuous
Ratio
Ratio
Discrete
Continuous
JMP® "Modeling
Type"
Nominal
Ordinal
"Continuous"
Note: The type of variable is indicated by the scale of measurement.
typvar.docx
1
9/24/2013
1. Categorical, classification or qualitative variables
a. Nominal or "Attribute"
The set of all possible values fall into a finite set of mutually exclusive and
exhaustive classes. Each observation falls into one and only one class.
The values of nominal variables need not be numerically meaningful: addition,
subtraction, multiplication, and division do not necessarily make sense.
General Form:
Variable (Values)
Examples:
Sex (male, female)
Sex (0, 1)
Color (red, yellow, blue, ...)
Genus (oak, pine, birch, ...)
Academic level (freshman, sophomore, junior, senior, other)
b. Ordinal or "Rank"
A nominal variable whose classes or categories have a natural, logical, order.
General Form:
Variable (Values)
Examples:
Quality (poor, fair, good, excellent)
Academic level (freshman, sophomore, junior, senior, graduate)
Grade (A, A−, B+, B, ...)
Temperature (cold, cool, lukewarm, warm, hot)
Height (short, average, tall)
2. Quantitative or "Measurement" (= "Continuous" Modeling Type in JMP)
typvar.docx
2
9/24/2013
a. Interval
All possible values are numbers, and subtraction makes sense (intervals are
meaningful).
General Form:
Variable (Values)
Examples:
temperature (degrees Fahrenheit)
temperature (°C)
direction (degrees)
b. Ratio
All possible values are numbers, and multiplication and division make sense
(ratios are meaningful). I.e., zero (0) means "none".
General Form:
Variable (Values)
Examples:
Variable (Values)
Height (ft)
Weight (gm)
Volume (cm3)
Age (years)
Note that direction (degrees) is interval,
because a direction of 0° does not mean
“no direction”, and a direction of 20°, is
not twice as much direction as 10°, so
ratios do not make sense.
Angle (degrees) is ratio, because an angle
of 0° is no angle at all, and a 20° angle is
twice a 10° angle, so ratios do make sense.
Angle (degrees or radians)
Number of eggs layed by an individual insect (0, 1, 2, ... , 332, ...,
712, ...)
Baskets in 60 seconds (0, 1, 2, ...)
Number of children in a family (0, 1, 2, ...)
typvar.docx
3
9/24/2013
Number of strikeouts in an inning (0, 1, 2, 3)
Counts, or counting variables
The last four examples are counts. They are quantitative because they are
numerically meaningful. They are ratio-scale variables because "0" means
"none". But they are discrete rather than continuous, and there may be only a
finite set of possible values (e.g., number of strikeouts in an inning).
Discrete vs. Continuous
Quantitative variables are variables whose values are real numbers. If all values in
some interval are possible observed values, then the variable is continuous. If only
isolated values, e.g., only integers, are possible, than the variable is discrete.
Physical measurements like length, weight, volume, time, temperature, etc. are
continuous. Counts, like number of eggs layed, baskets in 60 seconds, number of
children in a family, and number of strikeouts in an inning are discrete.
Continuous Variables and Rounding. All continuous random variables, like
temperature (°C), mass (kg), time (hr), etc., are rounded. Because all continuous
variables are rounded, rounding does not change a continuous variable to a
discrete variable. Consider time to complete a task (sec), with observed values of
83.2, 4.1, 22.7, ... These are observations of time, rounded to the nearest tenth of a
second. Consider the variable age (yr), with observed values of 24, 32, 18, 6, 56,
... These are observations of time, rounded to the nearest year. Both time to
complete a task (sec) and age (yr) are continuous rather than discrete variables.
Note: Some authors refer to quantitative random variables as measurements.
Identification of Variables
The format for the identification of a variable is determined by, and indicates, the type of
variable. This format is always used the first time we identify a variable in a report, article, or
other publication (including homework and tests!). It's a good idea to use it all the time!
Qualitative (categorical, attribute, classification) variables are identified by following the
name of the variable with a list of its levels (categories, classes). Levels are the possible values of
the variable. E.g.:
temperature (low, medium, high).
Continuous quantitative (measurement) variables always have units of measurement, and
therefore are identified by following the name of the variable with the units in parentheses, e.g.,
temperature (°C)
typvar.docx
4
9/24/2013
Discrete quantitative variables, i.e., counts, have no units. The levels are integers, so they can be
identified simply by their names, but we include an indication of the levels for emphasis, e.g.,
number of eggs laid (0, 1, ...)
Complete, One-Sentence Identification of the (Underlying) Random Variable of
Interest ← Important
Every study (survey, experiment, or observational), entails the observation of random variables.
The set of such observations are called the sample (or, vaguely, the data). The purpose of the
study is to make an inference about the population based on the sample. Thus, a complete
identification of a random variable of interest is to identify the population and the sample size
(number of observations drawn from the population) as well as the variable and its values or
units. Here are some examples.
Ti = the temperature (low, medium, high) of the i-th randomly sampled hamburger served at
Burger King, i = 1, 2, ..., 25.
That one sentence tells us that the variable of interest is





temperature (low, medium, high)
qualitative, ordinal, three levels
denoted by Ti
a sample of size n = 25
from the population of all hamburgers served at Burger King
Ui = the temperature (C) of the i-th randomly sampled chicken wing served at McDonalds, i = 1,
2, ..., 18.
That one sentence tells us that the variable of interest is





temperature (C)
quantitative, interval, units of °C
denoted by Ui
a sample of size n = 18
from the population of all chicken wings served at McDonalds
Yi = the number of eggs laid (0, 1, ...) by the i-th randomly selected corn ear worm, i = 1, 2, ...,
75.
That one sentence tells us that the variable of interest is




number of eggs laid (0, 1, ...)
quantitative, ratio, discrete count
denoted by Yi
a sample of size n = 75
typvar.docx
5
9/24/2013

from the population of all corn ear worms
If we are reading an article or report about a study done by others, we encounter the “one
sentence” from which we deduce the populations, units observed, variable observed, type of
variable, levels, and sample size.
I we are planning our own research, we reverse the process. For example, we want to know about
the quality of fast food. We decide to study one fast-food company, and we choose Burger King.
They serve dozens of foods. we decide to focus on hamburgers, the quality of hamburgers at
Burger King. So we have the population of all hamburgers served at burger King, and the
observational units are going to be hamburgers. Now, how do we gauge quality—temperature,
texture, appearance, taste? We choose temperature as a variable of interest (and perhaps some
others as well). Nest we decide how to measure temperature. Shall we use hot, warm, cool and
cold, thus having a qualitative ordinal variable? Or shall we measure temperature in degrees
centigrade, and have a quantitative, interval variable? Once we make the choice, we know the
type of variable. Finally, we have to decide on a sample size. Once we make all these
decisions—which we will learn how to do soon—we will be able to communicate it in the
documentation of the research by that “one sentence”.
Importance of the Hierarchy
The types nominal, ordinal, interval, ratio, form a hierarchy in the sense that




Nominal variables are fundamental, dividing all observations of a
variable into mutually exclusive and exhaustive classes
Ordinal variables have the properties of nominal variables, plus the
property of order.
Interval variables have all the properties of nominal and ordinal,
plus, intervals are meaningful: addition and subtraction make sense.
Ratio variables have all the properties of nominal, ordinal, and
interval variables, plus ratios are meaningful: multiplication and
division make sense.
Nominal
Ordinal
Interval
Ratio
The importance of this is that any statistical method—or any mathematical
manipulation at all—that is appropriate for a nominal variable is appropriate for all types,
because all types have the properties of the nominal. Likewise, any method appropriate for an
ordinal variable is appropriate for an interval or ratio variable, but not necessarily for a nominal
variable.
Reducing a variable to a more
fundamental type
h = height
height
(in)
(short, medium, tall)
h ≤ 60
short
60 < h ≤ 72
medium
typvar.docx
6
9/24/2013
Suppose we observe height (in). This is a ratio variable, so
h > 72
tall
it can be treated as an interval variable as well. Moreover,
we can reduce it to ordinal, by redefining it as height (short, medium, tall), where short means
less than 60 inches, medium means between 60 and 72 inches, and tall means greater than 72
inches. To be careful about observations that exactly equal 60 or 72 inches, we would more
precisely specify as shown on the right.
Exercise Set A
Instructions. Answer the following question with complete sentences on your own 8.5×.11 inch
paper.
1. Define empirical. Look up the term in a good dictionary, find the one most appropriate
definition for our purposes, and properly cite the source of your definition.
Exercise Set B
Instructions. Answer the following questions on your own 8.5×.11 inch paper.
These questions ask you to identify random variables. Do this by writing the name of the
variable followed by an indication of the possible values in parentheses.
For a qualitative random variable, put some or all of the possible values in parentheses.
Examples


Sex (male, female)
Color (red, yellow, ...)
For a continuous quantitative random, variable just put the units of measurement in parentheses.
Examples


Temperature (degrees F)
Height (ft)
For a discrete count, there is no unit of measurement, but make it clear as follows.
Examples


Number of eggs laid (0, 1, …)
Number of insects captured (0, 1, …)
Exercises
1. Give an example of a nominal-level qualitative random variable. Don't use any of the
examples already given in this handout.
typvar.docx
7
9/24/2013
2. Give an example of an ordinal-level qualitative random variable. Don't use any of the
examples already given in this handout.
3. Give an example of a discrete quantitative random variable. Don't use any of the
examples already given in this handout. List five reasonable observed values.
4. Give an example of a continuous quantitative random variable. Don't use any of the
examples already given in this handout. List five reasonable observed values.
5. Ask a good question about "Types of Variables".
© 1996, 2001, 2012, 2013, Golde I. Holtzman, all rights reserved
Department of Statistics, Virginia Tech (VPI)
URL: …/STAT5605/typvar.html
typvar.docx
8
9/24/2013