A qualitative variable is a variable whose values place observations into categories rather than measure a numerical amount. Also called a categorical variable, it may be nominal, with no natural category order, or ordinal, with a meaningful order. Binary variables contain two categories, while polytomous variables contain more than two.

Introduction
Researchers collect information by defining variables and recording a value for each observation. Some variables measure quantities, such as height, income, temperature, or the number of hospital visits. Other variables classify observations by attributes, groups, labels, or ordered levels. These are qualitative variables.
Understanding qualitative variables is important because the variable type affects:
- how data should be collected and coded;
- which summary measures are meaningful;
- which tables and charts should be used;
- which statistical tests and models are appropriate;
- how results should be interpreted and reported.
This guide explains the definition and types of qualitative variables, provides examples from several disciplines, and shows how researchers can code, analyse, visualize, and report them accurately.
Key takeaways
- A qualitative variable records categories, labels, or ordered levels rather than measured amounts.
- “Qualitative variable” and “categorical variable” are usually used as synonyms in introductory statistics.
- Nominal variables have no inherent category order; ordinal variables do.
- Binary describes a variable with two categories, not necessarily a separate measurement scale.
- Numerical codes such as 0, 1, and 2 do not automatically make a variable quantitative.
- Variable classification should be based on what the values mean, not merely how they appear in a spreadsheet.
What Is a Qualitative Variable?
A qualitative variable is a characteristic that assigns each observation to a category. Its possible values describe a type, status, group, attribute, or ordered level rather than a measurable quantity.
For example, suppose a university records each student’s:
- programme of study;
- mode of attendance;
- year of study;
- satisfaction level;
- age.
Programme of study and mode of attendance are nominal qualitative variables. Year of study and satisfaction level are ordinal qualitative variables. Age measured in years is ordinarily quantitative.
Qualitative variables are commonly called categorical variables because their values divide observations into categories. In R, they are frequently represented as factors. Statistical software may also describe their possible values as levels.
Variable, category, and observation
These terms should not be confused:
- Variable: the characteristic being recorded, such as blood type.
- Categories or levels: the possible values, such as A, B, AB, and O.
- Observation: the person, object, organization, event, or other unit on which the variable is recorded.
- Recorded value: the category assigned to a particular observation.
If a patient’s blood type is O, “blood type” is the variable and “O” is that patient’s recorded category.
Characteristics of Qualitative Variables
A qualitative variable usually has the following characteristics.
Its values represent categories
The values identify groups or attributes. Examples include product type, country of manufacture, diagnosis category, political system, and teaching method.
Arithmetic is not inherently meaningful
If departments are coded as:
the code 3 is not three times the code 1, and averaging department codes would not produce a meaningful “average department.”
Categories may be ordered or unordered
The categories red, blue, and green do not possess a natural ranking. In contrast, low, medium, and high do have a meaningful order.
A variable may be qualitative even when numbers are displayed
Postal codes, identification numbers, telephone numbers, shirt sizes coded from 1 to 5, and survey categories coded from 0 to 4 may all appear numerical. Their classification depends on what the numbers represent.
Frequencies are numerical even when the variable is qualitative
The variable “preferred learning mode” may be qualitative, but researchers can count how many respondents selected classroom, online, or hybrid learning. The resulting counts and percentages are quantitative summaries of a qualitative variable.
Types of Qualitative Variables
The two principal measurement types are nominal and ordinal. Binary and polytomous describe the number of available categories.
Nominal Qualitative Variable
A nominal variable has categories with no inherent ranking or meaningful order.
Examples include:
- blood type;
- academic department;
- mode of transport;
- country of birth;
- type of research design;
- operating system;
- species;
- preferred payment method.
The categories may be arranged alphabetically or placed in a convenient sequence, but this arrangement does not create a substantive ranking.
For example, listing bus before car does not imply that bus is lower, earlier, or smaller than car.
What can be calculated for nominal variables?
Researchers can ordinarily report:
- frequency;
- proportion;
- percentage;
- mode;
- cross-tabulations;
- measures of association appropriate for categorical data.
A mean or standard deviation of arbitrary nominal codes is not meaningful.
Ordinal Qualitative Variable
An ordinal variable has categories that can be ranked, but the distances between adjacent categories are not known to be equal.
Examples include:
- strongly disagree, disagree, neutral, agree, strongly agree;
- mild, moderate, severe;
- beginner, intermediate, advanced;
- low, medium, high risk;
- first, second, and third place;
- undergraduate, master’s, and doctoral level;
- poor, fair, good, very good, excellent.
The order contains information, but the difference between “poor” and “fair” cannot automatically be assumed to equal the difference between “good” and “very good.”
This distinction is central to the traditional nominal–ordinal–interval–ratio framework associated with levels of measurement (Stevens, 1946).
Can ordinal variables be treated as numerical?
Sometimes researchers analyse an ordinal scale using numerical methods, particularly when several related items are combined into a composite score. However, this requires justification.
A single five-category satisfaction item remains ordinal merely because it is coded 1 to 5. Treating it as continuous assumes that the category differences are sufficiently comparable for the intended analysis. Researchers should explain this decision and examine whether an ordinal method would be more appropriate.
Binary or Dichotomous Variable
A binary, dichotomous, or two-category variable has exactly two possible categories.
Examples include:
- consent given: yes or no;
- test result: positive or negative;
- course completed: completed or not completed;
- device status: active or inactive;
- outcome: survived or did not survive.
Binary variables are often coded 0 and 1. These codes make calculation and modelling convenient, but the variable remains categorical.
Binary is not always a third measurement scale
Nominal and ordinal classify variables according to order. Binary and polytomous classify them according to number of categories.
A binary variable may therefore be:
- nominal, when neither category has a natural ranking; or
- ordinal, when one category represents a higher or later state, such as fail/pass.
In many analyses, the nominal-versus-ordinal distinction has little practical effect when only two categories exist, but the conceptual distinction remains useful.
Polytomous Variable
A polytomous variable has more than two categories.
Examples include:
- blood type with four categories;
- employment status with several categories;
- satisfaction measured at five levels;
- treatment group with three interventions;
- region with multiple geographical categories.
A polytomous variable can be nominal or ordinal.
| Number of categories | Unordered | Ordered |
|---|---|---|
| Two | Binary nominal | Binary ordinal |
| More than two | Polytomous nominal | Polytomous ordinal |
How to Identify a Qualitative Variable
Use the following process.
Step 1: Identify what the variable records
Ask what each recorded value means. Does it measure an amount, or does it assign an observation to a group?
“Number of books read” records a count. “Preferred book genre” records a category.
Step 2: Ask whether arithmetic has substantive meaning
Would adding, subtracting, averaging, or comparing numerical distances produce a meaningful interpretation?
Calculating an average age is meaningful. Calculating an average postcode is not.
Step 3: Determine whether the categories have a natural order
If the categories cannot be ranked, the variable is nominal. If they can be ranked but the intervals are not established as equal, it is ordinal.
Step 4: Count the possible categories
Two categories indicate a binary variable. More than two indicate a polytomous variable.
Step 5: Check the research context
The same concept may be recorded in different ways.
Age may be recorded as:
- exact age in years: quantitative;
- child, adolescent, adult, older adult: ordinal qualitative;
- under 18 or 18 and over: binary qualitative.
The classification applies to the variable as operationalized in the dataset, not merely to the general concept.
Examples of Qualitative Variables
| Field | Variable | Possible categories | Classification |
|---|---|---|---|
| Education | Teaching mode | In person, online, hybrid | Nominal |
| Education | Academic level | Undergraduate, master’s, doctoral | Ordinal |
| Healthcare | Blood group | A, B, AB, O | Nominal |
| Healthcare | Disease severity | Mild, moderate, severe | Ordinal |
| Business | Payment method | Cash, card, transfer, mobile wallet | Nominal |
| Business | Customer satisfaction | Very dissatisfied to very satisfied | Ordinal |
| Psychology | Treatment condition | Control, cognitive intervention, behavioural intervention | Nominal |
| Sociology | Housing status | Owner, renter, temporary accommodation | Nominal |
| Environmental science | Pollution category | Low, moderate, high, critical | Ordinal |
| Computer science | Operating system | Windows, macOS, Linux, other | Nominal |
| Machine learning | Fraud status | Fraud, not fraud | Binary nominal |
| Clinical research | Treatment response | None, partial, complete | Ordinal |
| Employment research | Contract type | Permanent, temporary, freelance | Nominal |
| Survey research | Agreement | Strongly disagree to strongly agree | Ordinal |
| Engineering | Failure mode | Thermal, mechanical, electrical, software | Nominal |
Qualitative Variable vs. Quantitative Variable
A quantitative variable records a numerical amount obtained through counting or measurement. A qualitative variable assigns observations to categories.
| Feature | Qualitative variable | Quantitative variable |
|---|---|---|
| Main purpose | Classification | Measurement or counting |
| Typical values | Labels or ordered categories | Numerical amounts |
| Examples | Blood type, region, satisfaction level | Height, income, age, number of errors |
| Main types | Nominal and ordinal | Discrete and continuous |
| Arithmetic | Usually not meaningful on category codes | Generally meaningful |
| Common summaries | Counts, percentages, mode; median for suitable ordinal data | Mean, median, standard deviation, range |
| Common graphs | Bar chart, stacked bar chart, mosaic plot | Histogram, box plot, scatterplot |
| Example model | Logistic regression | Linear regression |
Qualitative is not the same as discrete
A qualitative variable has separate categories, but it should not automatically be called a discrete quantitative variable.
For example:
- number of children is discrete quantitative because it is a count;
- family type is nominal qualitative because it is a category;
- household-size group—one person, two to four, or five or more—is ordinal qualitative because a numerical count has been grouped.
Qualitative Variable vs. Qualitative Data and Qualitative Research
These expressions are related but not interchangeable.
Qualitative variable
A qualitative variable is a statistical variable whose values are categories. It can be analysed using counts, proportions, contingency tables, categorical regression, and other statistical procedures.
Qualitative data
In introductory statistics, “qualitative data” often means the category values produced by a qualitative variable.
In research-methods literature, however, qualitative data may also refer to interview transcripts, field notes, documents, photographs, audio, or open-ended responses.
Qualitative research
Qualitative research is a methodological approach used to understand meanings, experiences, processes, interpretations, and contexts. It may use interviews, observations, focus groups, documents, or other rich forms of evidence.
A statistical study can therefore contain qualitative variables without being a qualitative research study. For example, a large survey analysed with logistic regression may include region, occupation, and satisfaction level as qualitative variables while remaining a quantitative study.
How Qualitative Variables Are Collected and Operationalized
A qualitative variable must be defined before data collection.
Define the underlying concept
State what the variable is intended to represent. “Employment status,” for example, may refer to a participant’s current main activity, contractual status, or labour-force classification. These are not identical concepts.
Create appropriate categories
Categories should normally be:
- clearly defined;
- relevant to the research question;
- distinguishable from one another;
- sufficiently comprehensive for the study population;
- neither unnecessarily detailed nor excessively broad.
Decide whether multiple responses are permitted
A single-response variable assumes that each observation belongs to one category. Some concepts require multiple responses.
For example, a participant may use several social-media platforms. This should be recorded as a multiple-response item or as separate binary variables rather than forcing the participant into one platform category.
Separate substantive and missing categories
Researchers should distinguish:
- no;
- not applicable;
- do not know;
- prefer not to answer;
- not asked;
- missing because of a recording error.
These values can have different meanings and should not automatically be merged.
Preserve the original detail where possible
Grouping a quantitative variable may make results easier to communicate, but it also removes information.
For example, converting exact income into low, middle, and high categories reduces precision and makes the findings dependent on the selected cut points. Researchers should preserve the original variable when legally, ethically, and practically appropriate.
Qualitative-Variable Data-Dictionary Template
A data dictionary makes the coding scheme transparent and reproducible.
| Field | Example |
|---|---|
| Variable name | satisfaction |
| Concept | Satisfaction with university support |
| Question or source | “Overall, how satisfied are you with student support?” |
| Measurement type | Ordinal |
| Permitted categories | Very dissatisfied, dissatisfied, neutral, satisfied, very satisfied |
| Stored codes | 1, 2, 3, 4, 5 |
| Category order | 1 < 2 < 3 < 4 < 5 |
| Missing codes | 97 = not applicable; 98 = prefer not to answer; 99 = missing |
| Unit of observation | Student |
| Time reference | Current academic semester |
| Variable role | Outcome |
| Notes | Single response only |
How to Code Qualitative Variables
Codes should facilitate analysis without changing the meaning of the variable.
Coding a nominal variable
A nominal variable may be stored using text labels:
- Biology
- Chemistry
- Physics
It may also be stored using numeric codes:
- 1 = Biology
- 2 = Chemistry
- 3 = Physics
These numbers are labels, not quantities.
Coding an ordinal variable
An ordinal variable may be coded in its natural order:
- 1 = low
- 2 = medium
- 3 = high
The ordering is meaningful, but the difference between 1 and 2 is not automatically equal to the difference between 2 and 3.
Dummy or indicator coding
A nominal variable with (k) categories is often represented in a regression model using indicator variables.
For a transport variable with bus, car, bicycle, and walking, a model may use three indicator variables and treat the fourth category as the reference.
The estimated coefficients then compare each represented category with the reference category.
One-hot encoding
Many machine-learning systems create one binary column for every category. This is called one-hot encoding.
For example:
| Original category | Bus | Car | Bicycle |
|---|---|---|---|
| Bus | 1 | 0 | 0 |
| Car | 0 | 1 | 0 |
| Bicycle | 0 | 0 | 1 |
One-hot encoding avoids imposing an artificial ranking. However, it can create a very large number of columns when the original variable has many categories.
Ordinal encoding
Ordinal encoding assigns ordered numbers to ordered categories. It should be used only when the order is real and the model’s treatment of the codes is appropriate.
Encoding red, green, and blue as 1, 2, and 3 may incorrectly suggest an order. Encoding low, medium, and high as 1, 2, and 3 preserves their order, although it may still imply spacing that the model does not handle appropriately.
How to Summarize Qualitative Variables
Frequencies
A frequency table reports how many observations fall into each category.
Proportions and percentages
For category (j):
[
\text{Percentage in category }j =
\frac{\text{frequency in category }j}
{\text{number of relevant observations}}
\times 100
]
The denominator must be stated clearly. A percentage based on valid responses may differ from one based on the full sample.
Mode
The mode is the most frequently observed category. It can be used with nominal or ordinal variables.
Median and percentiles
A median may be meaningful for ordinal data when the categories can be placed in a clear order. It is not meaningful for an unordered nominal variable.
Contingency tables
A contingency table, also called a cross-tabulation, summarizes two categorical variables.
For example, a researcher might cross-tabulate teaching mode by course-completion status to compare completion percentages across in-person, online, and hybrid courses.
How to Visualize Qualitative Variables
Bar chart
A bar chart is generally the clearest display for one qualitative variable. The bar heights represent counts or percentages.
For ordinal variables, categories should be displayed in their substantive order rather than alphabetically.
Grouped or clustered bar chart
A grouped bar chart compares category distributions across another variable.
Stacked bar chart
A stacked bar chart shows the composition of groups. A 100% stacked bar chart is useful for comparing proportions when group sizes differ.
Mosaic plot
A mosaic plot displays relationships between two or more categorical variables. The areas of the rectangles correspond to category frequencies.
Pie chart
A pie chart can show a small number of mutually exclusive categories that form a meaningful whole. Bar charts are usually easier to compare accurately, particularly when categories have similar proportions or when there are many categories.
Graphs to avoid
A histogram should not normally be used for nominal categories. Histogram bars represent intervals on a quantitative scale and therefore touch one another. Bar-chart categories are separate and the bars are conventionally separated.
Statistical Tests and Models for Qualitative Variables
The appropriate method depends on:
- the research question;
- whether the qualitative variable is a predictor or outcome;
- whether it is nominal, ordinal, or binary;
- the number of categories;
- sample size and cell frequencies;
- independence or pairing of observations;
- study design and model assumptions.
The following table is a guide rather than a substitute for a full analysis plan.
| Research situation | Possible method |
|---|---|
| Compare one categorical distribution with expected proportions | Chi-square goodness-of-fit test or an exact alternative |
| Test association between two categorical variables | Chi-square test of independence |
| Two categorical variables with small expected cell counts | Fisher’s exact test or another exact method |
| Paired binary responses | McNemar test |
| Agreement between categorical ratings | Cohen’s kappa or an appropriate multi-rater measure |
| Binary outcome with one or more predictors | Binary logistic regression |
| Unordered outcome with more than two categories | Multinomial logistic regression |
| Ordered categorical outcome | Ordinal logistic regression or another ordinal model |
| Quantitative outcome across two categorical groups | Independent-samples or paired t test, when assumptions and design permit |
| Quantitative outcome across three or more groups | Analysis of variance, when assumptions and design permit |
| Ordinal outcome across independent groups | Rank-based or ordinal-model approach, depending on the question |
| Time-to-event outcome with categorical predictor | Survival model such as Cox regression, when appropriate |
Categorical-data analysis extends far beyond simple frequency tables. It includes probability models, contingency-table methods, logistic models, log-linear models, ordinal models, measures of agreement, and methods for repeated or clustered observations (Agresti, 2018).
Effect sizes and confidence intervals
A statistically significant result does not by itself indicate a large or important association.
Depending on the analysis, researchers may report:
- risk difference;
- risk ratio;
- odds ratio;
- Cramér’s V;
- phi coefficient;
- predicted probabilities;
- confidence intervals.
The effect measure should match the research question and study design.
How Qualitative Variables Are Used in Modern Research
Survey research
Surveys use qualitative variables for opinions, preferences, behaviours, roles, demographic classifications, and ordered rating responses.
Clinical and public-health research
Examples include diagnosis, treatment group, adverse-event classification, disease stage, response status, and survival status.
Education research
Researchers may analyse programme type, instructional mode, qualification level, attendance category, grade band, and completion status.
Social and behavioural research
Qualitative variables can represent institutional categories, household structure, occupation, social role, attitudes, perceptions, and behavioural classifications.
Business and market research
Businesses use product category, customer segment, subscription status, purchase channel, satisfaction level, and churn status.
Computer science and machine learning
Categorical features are used in classification, recommender systems, fraud detection, customer prediction, natural-language applications, and administrative datasets.
Digital Research Tools, Machine Learning, and AI
SPSS
SPSS allows researchers to specify nominal, ordinal, or scale measurement levels. Numeric values can be assigned value labels, such as 0 = no and 1 = yes.
The measurement setting should be checked after importing data because software may infer the type incorrectly from the stored values.
R
R commonly represents qualitative variables as factors. An ordered factor is appropriate when levels have a substantive ranking.
Researchers should check:
- factor levels;
- reference category;
- missing values;
- unused levels;
- order of ordinal levels.
Python and pandas
Pandas provides a categorical data type with defined categories and an option indicating whether they are ordered.
The stored integer codes are an internal representation and should not be interpreted as measured quantities.
jamovi
Jamovi distinguishes nominal, ordinal, continuous, and ID variables. Researchers can reorder levels and define labels within the variable editor.
Machine-learning software
Many machine-learning estimators require categorical features to be transformed. Common approaches include:
- one-hot encoding;
- ordinal encoding;
- frequency encoding;
- hashing;
- target encoding;
- models with native categorical-feature support.
The transformation should be selected within the model-validation process. Estimating target-based encodings before splitting or cross-validating data can leak outcome information into the predictors.
High-cardinality variables
A high-cardinality qualitative variable contains many categories, such as thousands of product codes or occupations.
Problems may include:
- sparse observations;
- unstable estimates;
- excessive model dimensions;
- rare or previously unseen categories;
- privacy and re-identification risks.
Possible responses include carefully combining rare levels, hierarchical modelling, regularization, hashing, or using a method designed for categorical features. Categories should not be merged solely to improve a model without considering substantive meaning.
Artificial intelligence
AI tools can assist with:
- detecting inconsistent spelling;
- suggesting possible category groupings;
- drafting a data dictionary;
- checking whether labels appear duplicated;
- generating code for tables or graphs;
- documenting recoding rules.
AI should not independently decide which categories are scientifically, ethically, or socially valid. Suggested recoding must be checked against the research question, source instrument, disciplinary standards, participant meaning, and potential bias.
Confidential or identifiable datasets should not be uploaded to an AI service unless its privacy, security, contractual, and ethical conditions have been reviewed.
Advantages of Qualitative Variables
Qualitative variables:
- represent attributes that cannot be adequately described as numerical amounts;
- make group comparisons possible;
- support classification and segmentation;
- are easy to summarize with counts and percentages;
- can function as predictors, outcomes, controls, or stratification variables;
- support interpretable statistical models;
- are common across academic disciplines and applied research.
Limitations of Qualitative Variables
Categories may oversimplify variation
Grouping age into broad bands removes the differences between individuals within each band.
Boundaries may be arbitrary
The distinction between low, medium, and high may depend on researcher-selected thresholds.
Categories may overlap
A poorly designed employment variable might include “student,” “employed,” and “self-employed,” even though a participant could belong to more than one category.
Rare categories create sparse data
Very small cells may reduce precision, violate approximations used by some tests, or produce unstable model estimates.
Labels may change over time
Administrative, clinical, technological, and social classifications may require revision. Researchers should record the classification version and date when relevant.
Ordinal distances are uncertain
Although ordinal categories have an order, their spacing is not automatically equal.
Coding can introduce bias
Researcher-created categories may exclude important responses, impose inappropriate labels, or conceal heterogeneity.
Common Mistakes
Assuming every numerical column is quantitative
A telephone number, participant ID, product code, or postcode is usually an identifier or nominal variable rather than a numerical measurement.
Calculating a mean of nominal codes
The average of codes assigned to departments or blood groups has no substantive interpretation.
Treating binary as a completely separate scale
Binary describes the number of categories. The categories may still be nominal or ordinal.
Assuming ordinal codes have equal intervals
The movement from dissatisfied to neutral may not represent the same change as the movement from neutral to satisfied.
Confusing a qualitative variable with qualitative research
Categorical variables are routinely analysed in quantitative studies.
Automatically converting continuous data into categories
Categorization can reduce statistical information, obscure nonlinear patterns, and create results that depend on arbitrary thresholds.
Ignoring category order in software
If low, medium, and high are alphabetically sorted, tables and graphs may display high, low, medium. The intended order should be explicitly defined.
Treating missing values as an ordinary category
A missing response may indicate refusal, inapplicability, data loss, or skip logic. Each possibility should be documented.
Merging rare categories without justification
Combining categories may improve cell size but can distort meaning or hide relevant differences.
Using an inappropriate statistical test
The test should reflect measurement level, design, sample size, pairing, distributional assumptions, and the roles of the variables.
Practical Checklist for Researchers
Before analysing a qualitative variable, verify the following:
- The variable has a clear conceptual and operational definition.
- Categories correspond to the research question.
- Categories are clearly labelled and appropriately distinct.
- Nominal or ordinal status has been identified.
- Binary or polytomous status has been recorded.
- The intended ordinal order is explicitly defined.
- Numerical codes are documented in a codebook.
- Missing and not-applicable responses are distinguishable.
- Multiple-response items are stored appropriately.
- Rare and unexpected categories have been reviewed.
- The reference category for modelling is substantively appropriate.
- Tables and graphs use meaningful category order.
- The selected statistical test matches the design and variable roles.
- Effect sizes and confidence intervals are reported where appropriate.
- Any AI-assisted recoding has been independently checked and documented.
Conclusion
A qualitative variable classifies observations into categories rather than measuring a numerical amount. Nominal variables contain unordered categories, while ordinal variables contain ordered categories with no guaranteed equal spacing. Binary and polytomous describe the number of categories. Correct classification helps researchers design better instruments, code data accurately, select valid analyses, and interpret results without assigning numerical meaning where none exists.
References
- Agresti, A. (2018). An introduction to categorical data analysis (3rd ed.). Wiley.
- Australian Bureau of Statistics. (n.d.). Quantitative and qualitative data.
- Chen, D., & Anderson, C. J. (2024). Categorical data analysis. arXiv. https://doi.org/10.48550/arXiv.2409.02942
- IBM. (n.d.). Variable measurement level: IBM SPSS Statistics documentation.
- pandas development team. (n.d.). Categorical data: pandas documentation.
- Pennsylvania State University. (n.d.). Categorical and quantitative variables.
- R Core Team. (n.d.). Factors: R documentation.
- scikit-learn developers. (n.d.). OneHotEncoder: scikit-learn documentation.
- Stevens, S. S. (1946). On the theory of scales of measurement. Science, 103(2684), 677–680. https://doi.org/10.1126/science.103.2684.677
