Categorical Variables: Example Slides

Grace Tompkins

Land Acknowledgement

We acknowledging that the land on which we gather is the traditional, ancestral, and unceded territory of the xwməθkwəy̓əm (Musqueam) People.

Throughout this course, we will be weaving Indigenous topics into more “traditional” course material. I myself am a settler and am new to some of these topics. I am grateful for the opportunity to learn and grow with you.

Classroom Policy

As stated in the syllabus, there is a zero tolerance policy for disrespectful behaviour in this classroom.

  • This includes within physical the classroom community (your peers, TAs, instructors, support staff) and online (discussion forums, social media).

Some sensitive topics will be discussed throughout this course.

  • We are all learners and it is okay to make mistakes.

  • We will offer each other corrections politely, and I ask that you keep an open mind as we all continue to learn in this space.

This classroom is a safe space. You are welcome here.

Learning Outcomes:

By the end of this lectures, students will be able to:

  • Define a categorical variable

  • Identify when a variable is categorical

  • Identify when a categorical variable may cause issues for analysis

  • Justify coarsening the number of levels of a categorical variable

  • Identify when such coarsening may be inappropriate from a cultural standpoint

Categorical Variables

Definition

A variable is considered categorical when it can take on a finite number of distinct levels or categories.

  • These are qualitative in nature, meaning the levels are descriptive, even if represented by a number.

  • They may have no specific order (nominal) or have an natural ordering (ordinal)

Examples:

  • Highest completed level of education: secondary, post-secondary, graduate (ordinal)

  • Eye colour: brown, blue, green, hazel, other (nominal)

Categorical Variables

Discussion

Classify the following variables as being either continuous or categorical:

  • Commute time

  • Commute method

  • Birthplace

  • Age

Categorical Variables: Number of Levels

  • Some categorical variables, like birthplace, can have a lot of unique levels.

    • Consider the case where we have data on 100 individuals with 30 different birthplaces.
    • If we tried to analyze the relationship between birthplace and another variable (say, income), we may run into issues where we do not have enough data in some groups to identify meaningful differences between birthplaces.
  • There is no universally agreed upon rule as to what constitutes having “too many levels” in a categorical variable, as it often depends on the method(s) being used.

  • Some statisticians argue that you must have >10 observations per level (in our example, this means having 10 or more people in each birthplace)

Categorical Variables: Number of Levels

So… how can you overcome this issue?

  1. Reduce the number of levels, for example:
  • Use domain knowledge to combine similar levels

  • Group categories with low frequency together

  • Use a statistical method to combine similar levels

  1. (Advanced) Use a regularization technique

  2. (Advanced: for hierarchical data) Use the levels as a random effect

Categorical Variables: Race and Ethnicity

Variables related to race and ethnicity are often collected for studies involving human data.

Definition

Race: a group of people who are arbitrarily categorized according to common physical characteristics, regardless of language, culture or nationality, as per Statistics Canada.

Ethnicity: the shared cultural, linguistic or religious characteristics of a group of people having a common history, heritage or ancestry. While these terms are often used interchangeably, there is a distinct difference which we emphasize here.

Categorical Variables: Race and Ethnicity

  • There are a lot of unique races and ethnicities that one can collect information on

  • Oftentimes, these categories are coarsened to have a more reasonable number of possible levels

    • Doing so can omit complex racial and ethnic identities which are grouped into broader categories.

    • Coarsening the levels may also not acknowledge the unique lived experiences of smaller or mixed-race identities [1].

  • Such simplifications may lead marginalized groups to be underrepresented in studies, furthering the feeling of invisibility and a lack of belonging [1].

Categorical Variables: Discussion

Discussion

In Canada, Métis have typically been recognized as a “mixed-descent identity” in studies [2]. How might this affect the Métis population?

Possible answer:

  • This undermines the Métis Nation as a self-governing Indigenous nation with associated rights and unique cultural experiences

  • For a summary on how Indigenous Peoples were represented in the Canadian Census from 1870 to 2021, see [3].

Categorical Variables: Discussion

Discussion

White or Caucasian is frequently shown at the top of tables listing race and ethnicity, and is typically used as a reference group to which other groups are compared [1]. Discuss in a small group how this may impact marginalized populations.

Possible answer:

  • Placing White at the top of a table or treating it as a reference category can reinforce ideas of white supremacy, stemming from Colonization.

Categorical Variables: Discussion

Continue the Lecture!

References

[1]
Sharghi S, Khalatbari S, Laird A, Lapidus J, Enders FT, Meinzen-Derr J, et al. Race, ethnicity, and considerations for data collection and analysis in research studies. Journal of Clinical and Translational Science 2024;8:e182.
[2]
Andersen C, Walter M, Kukutai T, Gabel C. Indigenous Statistics. 2nd ed. Routledge; 2025. https://doi.org/10.4324/9781003173342.
[3]
Orlandini R, Cooper A, Manuel K. Guide on ethnic, racial, and indigenous variables in the census of canada: 1870 to 2021 2021.