What’s a categorical variable?

Print anything with Printful



Categorical variables have two or more groups without order, while quantitative variables have numerical values. Ordinal variables have an inherent order, and data tables and bar charts are used to analyze categorical data.

A categorical variable, also called a nominal variable, is a type of variable that can have two or more groups, or categories, that can be assigned. There is no order for the categories to which a variable can be assigned. In other words, categories cannot be sorted from highest to lowest. An example of a categorical variable is race, which has many different categories but there is no ordering.

One way to determine the type of variable is whether it is quantitative or qualitative. A quantitative variable can be measured and has a specific numerical value. Examples of quantitative variables include height, weight, age, salary, temperature, etc. Any non-quantitative variable is qualitative or categorical. These types of variables have no numerical meaning when measured or observed, and include things like hair color, eye color, gender, hometown, etc.

Categorical variables are similar to ordinal variables in that both have specific categories that describe them. The difference between a categorical variable and an ordinal variable is that the latter has an inherent order. For example, a survey might ask respondents to rate claims as poor, good, and excellent. These are categorical variables, but there’s an obvious order, so they’re actually ordinal variables.

Data tables are typically used to analyze categorically grouped data. With a two-way data table, you can measure and compare two categorical variables. For example, hair color and gender could be measured for a group of individuals. The categorical variables that would be observed and recorded would be whether the person is male or female and what color their hair is. In the table, the number of observations for each group for the two variables would be entered into rows and columns based on the collected data.

Bar charts are often used as a graphical method for analyzing categorical variable data. The data you observe can be entered as raw numbers or as percentages, which are preferred. The total for each group is shown with a bar graph.
In the example above, the bar graph could represent the number of males or females or the number of individuals within each hair color category. A segmented bar graph can provide a method of showing numbers captured during observations instead of a straight total for each group. Using the same hair color and gender data, a segmented bar graph could show how many males and females of each hair color were observed.




Protect your devices with Threat Protection by NordVPN


Skip to content