3. Types of Variables
3. Types of Variables
Variables Prajkta
Bhide, PhD
What is a variable?
➢ A variable is a quantity or a factor in which the value varies as opposed to
a constant.
• Can be measured – blood pressure (mm Hg), body temperature, illness
episodes, body fat %, births/deaths, sex etc.
• Can be manipulated / controlled - exercise for 5 min or 30 min, drug
dosage 120 mg vs 180 mg, sleep for 8 hours or stay up all night etc. •
Skin colour/presence of disease/genetics
2
3
Independent variable
Dependent variable
• An independent variable is a
• A dependent variable is one that
variable whose value is not
is influenced by other variables.
affected by other variables.
Independent variable
Influences
Dependent variable
• Explanatory variable, exposure
variable, input variable,
manipulated variable, predictor
variable
Crocin Fever
Dosage Body temperature
• Outcome variable
4
5
MTHFR genotypes in
NTD in offspring
mother
Dependent variable
Independent variables
7
How long
you sleep affects your test score.
Your test
score affects how long you sleep.
8
Types of Variables
• Variables can be classified into one of four types, depending on the type of
scale used to characterize their values:
variable 4. Ratio-scale
variable
1. Nominal-scale Categorical variables
variable 2. Ordinal-scale
variable 3. Interval-scale
Continuous variables
Categorical variable
• Qualitative
• Arranged into categories
• Examples: vaccination
status, MTHFR genotypes,
pain scale etc.
• Nominal
• Ordinal
10
Nominal-scale
• Any numerical values at the nominal level of measurement should not be treated as a
quantitative variable. An example of this would be a serial number or student ID number. It
makes no sense to do any calculation upon these types of numbers.
11
Ordinal-scale variables
➢ Two or more categories which can be ordered or ranked
(hierarchy)
• Ovarian cancer: Stage I, II, III, or IV
Cancer
remission
yes/no –
nominal,
binary
• However, the levels can be ranked, we cannot place a "value" to
them; we cannot say that ‘II’ is twice as bad as ‘I’.
12
Likert scale
• There is an obvious order or
hierarchy to the categories, but the
difference between Always and
Sometimes is not the same as the
difference between Rarely and
Never.
Always
Sometimes
Rarely
Never
13
Pain severity
Depression severity
Mild
No
14
Continuous variable
• Quantitative
• Associated with numbers
• Interval
• Ratio
15
Interval-scale variables
➢ Have a numerical value that can be measured along a continuum
➢ Differences in the numbers represent real differences in the
variable • Temperature measured in degrees Celsius or Fahrenheit -
difference between 20°C and 30°C is the same as 30°C to 40°C
• IQ scores
subtraction 16
Day – nominal
17
Ratio-scale variables
➢ Are interval variables with the added condition that 0 (zero) of the
measurement indicates that there is none of that variable. •
Height
• Weight
• The name "ratio" reflects the fact that the ratio of measurements can be
used. So, for example, a weight 10 kg is twice weight of 5 kg.
Discrete variables
➢ Variables that can only take on a finite number of values are called
discrete variables.
20
Identify
the type
of
variable:
1. Hypertension: mild, moderate and
severe
4. Age in years
21
Derived Variables
• A Derived Variable is a variable defined by a function or expression in
terms of other variables.
• They are variables that you create by calculating or categorizing variables
that already exist in your data set.
• Derived variables are used in the same way as any other variable.
• E.g. BMI (continuous) = derived from height and weight (both continuous).
BMI categories (categorical) would be a separate variable.
• E.g. Income categories (categorical) = by categorizing the actual income
data (continuous)
Age as a variable
• Age differs from the majority of other variables because age does not
follow the usual rules for rounding to the nearest integer. • For most
variables, 15.99 can be rounded to 16.
• However, an adolescent who is 15 years and 360 days old cannot
claim to be 16 years old (and hence get his/her driver’s license or
learner’s permit) for at least 5 more days.
Category Age precision
Adults Years
Children Months
Neonates Days
30-34
0-4
35-39
5-9
40-44
10-14
45-49
15-19
50-54
20-24
55-59
25-29
60-64
65-69 10 - 14
70-74 15- 19
75-79 20 - 24
80-84 25 - 44
85+ 45 - 64
65 - 79
Age group in Census 0 -4
80+
5 -9
Reading …
• https://www.cdc.gov/csels/dsepd/
ss1978/lesson2/section2.html
• https://www.scribbr.com/method
ology/types-of-variables/
• https://statistics.laerd.com/statisti
cal-guides/types-of-variable.php
25