Skip to main content
+ 
Data Basics 
Slides edited by Valerio Di Fonzo for www.globalpolis.org 
Based on the work of Mine Çetinkaya-Rundel of OpenIntro 
The slides may be copied, edited, and/or shared via the CC BY-SA license
Data matrix 
Data are organized in what we call a data matrix, where each row 
represents an observation or a case, and each column represents a 
variable:
Types of variables 
There are two types of variables, 
numerical and categorical. Numerical, in 
other words quantitative, variables take on 
numerical values. It is sensible to add, 
subtract, take averages, et cetera, with 
these values. Categorical, or qualitative, 
variables. Take on a limited number 
of distinct categories. These categories 
can be identified with numbers. For 
example, it is customary to see the gender 
variable coded as zero for male and one 
for females, but it wouldn't be sensible to 
do arithmetic operations with these 
values. 
Numerical variables can further be 
categorized as continuous or discrete. 
Continuous numerical variables are 
usually measured, such as height. 
These variables can take on any 
number of infinite values given, 
within a given range. Discrete 
numerical variables are those 
that take on one of a specific set of 
numeric values where we're able to 
count or enumerate all of the 
possibilities. One example of a 
discrete variable is the number of cars 
a household owns. In general, count 
data are an example of discrete 
variables. 
Categorical variables that have 
ordered levels are called ordinal. 
Think about a survey question 
where you're asked how satisfied 
you are with the customer service 
you received. And the options are 
very unsatisfied, unsatisfied, neutral, 
satisfied, and very satisfied. These 
levels have an inherent ordering. 
Hence the variable would be called 
ordinal. If the levels of categorical 
variable do not have an inherent 
ordering to them, then the variable is 
simply called categorical.
Types of variables (cont.) 
gender - categorical 
sleep - numerical, continuous 
bedtime - categorical, ordinal 
countries - numerical, discrete 
dread - categorical, ordinal (could also be used as numerical)
Associated vs. independent 
● When two variables show some connection with one 
another, they are called associated variables. 
○ Associated variables can also be called 
dependent variables and vice-versa. 
● If two variables are not associated, i.e. there is no 
evident connection between the two, then they are 
said to be independent.
Hypothesis Testing Framework 
● We start with a null hypothesis (H0) that represents the status 
quo. 
● We also have an alternative hypothesis (HA) that represents 
our research question, i.e. what we're testing for. 
● We conduct a hypothesis test under the assumption that the 
null hypothesis is true, either via simulation or theoretical 
methods. 
● If the test results suggest that the data do not provide 
convincing evidence for the alternative hypothesis, we stick 
with the null hypothesis. If they do, then we reject the null 
hypothesis in favor of the alternative. 
N.B. The slides of the case study on gender discrimination provide specific 
information regarding hypothesis testing.