From Variables to Data¶
Theory¶
Suggested Conceptual Reading & Discussion¶
Application¶
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)
With regards to your project idea
- Identify the key concepts with regards to your project idea.
- How are these concepts interrelated?
- Translate them into variables (DV, IV, CV)
Code: Live Demo & Hands-on Lab¶
Student Group Live Demo (Group 2)¶
- Topic: Python & Pandas Data Structures (Variables, lists, dictionaries, Series & DataFrames basics).
- Review the Live Demo Guidelines & Schedule.
Hands-on Practice¶
- 📘 Using a Notebook in VS Code
- Open Notebook #02 in VS Code to explore Python lists, dictionaries, and Pandas Series and DataFrame manipulation.
Something extra?¶
Put your paper on GitHub
- Create a new public or private repository.
- Upload the
main.typfile from Milestone 1. - Add a commit message: "My first commit, horray!"
- Push your contribution to the GitHub repository.
Get Ready for Next Session: Think. Explore. Practice.¶
Think¶
- Identify specific survey questions from ANES 2024 to operationalize your DV, IV, and control variables.
- Structure your proposal into a cohesive 5-paragraph narrative linking your research puzzle, theoretical mechanism, and empirical expectations.
- Suggested Reading: Mason, L. (2018). Ideologues without issues: The polarizing consequences of ideological identities. Public Opinion Quarterly, 82(S1), 866-887. - Demonstrates how distinct psychological and ideological identities in survey data produce measurable behavioral polarization.
Explore¶
- Live Demo (Group 3): Data Acquisition & Column Inspection. Group 3 prepares a 10–15 min demonstration and shares the handout on WhatsApp before class (groups can book a meeting with the instructor to get direction).
- The class should review the Pandas Indexing and Subsetting Guide to follow along and lead the peer discussion.
Practice¶
- Practice loading and exploring datasets using Notebook #02.
- Complete Milestone 2 - Proposal (Due Friday, Oct 23 at 08:00 before class via email).