Skip to content

From Variables to Data

Agenda

  • Theory
    • Presentation & Discussion
  • Application
    • Variables Types & Levels of Measurement
    • Milestone 1 Review
  • Code
    • Scientific Writing - Citing & Markdown
    • Functions and Packages

Theory

Presentation & Discussion

Variable Types & Levels of Measurement

Variables can broadly be categorized as either discrete or continuous.

  • Discrete variables are those that take on a countable number of values, meaning they can only be whole numbers. An example of a discrete variable is the number of voters in an election, which might be represented as 3,450 voters.
  • Continuous variables can take on an infinite number of values within a given range, allowing for more precise measurement. For instance, the time it takes for respondents to answer a survey can be a continuous variable, such as 2.5 minutes, indicating that time can be measured in fractions and is not limited to whole numbers.
Levels Description Example
Nominal Categories without any mathematical relation. Party Identification (e.g., Democrat Republican)
Ordinal Categories with a meaningful order but unequal intervals. Level of education (e.g., high school, bachelor's, master's, phd, ...)
Interval Numeric values with meaningful intervals but no true zero. Feeling Thermometer (e.g., survey responses on a scale from 0 to 100)
Ratio Numeric values with meaningful intervals and a true zero. Age of a respondent (e.g., 25 years old)

Let's practice:

  • Political Ideology - Measured on a scale (e.g., liberal to conservative)
  • Voter Turnout - Percentage of eligible voters who vote
  • Campaign Expenditure - Total amount of money spent on a campaign
  • Attitudes towards a government spending - Measured on a scale likert scale ranging from 1 to 7
  • Age of Respondents - Measured in categories (e.g. 18-25, 26-45, 46-65, 66+)
  • Gender - Categorical variable (e.g., male, female, non-binary, other)
  • Political Participation - Scale measuring levels of engagement (e.g., none, some, active)

Code

For next time