Data & Measurement

Categorical Data

Reviewed byShrishti Chaudhary

Definition

Categorical data are observations that represent distinct categories or groups rather than measured quantities, so there is no meaningful quantitative distance between categories, even when the categories have a natural order. Examples include blood type (A, B, AB, O), treatment group (drug, placebo), gender identity, marital status, and disease classification. Categorical data may be nominal (no inherent order) or ordinal (ordered categories, such as disease severity rated as mild, moderate, or severe).[1][3]

Explore the concept

Sort it, count it, never average it

Sort trial patients into categories to build a frequency table, shuffle three kinds of categories, then change the number given to one category and watch a comparison of means flip.

Treatment n = 200

Responded136

No response64

Placebo n = 200

Responded84

No response116

RespondedNo response1 tile = 4 patients

Each patient lands in one group

A response is not measured on a scale here: each patient either responded or did not. Sort them to see the data take shape.

The big idea: Categorical data place each observation in a group, so they are summarized with counts and proportions and compared with methods such as the chi square test. Numbers attached to categories are labels: averaging them invents distances the data do not contain.

Trial figures come from the example: 136 of 200 treated and 84 of 200 placebo patients responded (68% and 42%); chi square 27.3 (df 1, p < 0.001, no continuity correction); relative risk 0.68 / 0.42 = 1.62, 95% CI 1.34 to 1.96 (log method). Each tile stands for 4 patients, and which tile sits where in the pile is illustrative. The severity counts (group A 20, 70, 10; group B 45, 30, 25) are illustrative; mean codes are computed as the sum of count times code divided by 100, with mild coded 1 and severe coded 3.

Why it matters

Categorical data are ubiquitous in research. Demographic characteristics, treatment assignments, diagnostic categories, survey responses, and many clinical classifications are recorded as categorical variables. The statistical methods appropriate for categorical data differ from those used for continuous data, and applying the wrong method can produce invalid results. Understanding how to collect, summarize, and analyze categorical data is a core skill for researchers in almost every discipline. For systematic reviewers, much of the outcome data they synthesize (such as response rates, adverse event proportions, and diagnostic accuracy measures) is categorical.

How it works

Categorical data are summarized using frequency counts and proportions (or percentages) rather than means and standard deviations. A frequency table lists each category and the number of observations in that category. Bar charts and pie charts are common visual displays for categorical data.

Statistical analysis of categorical data depends on the research question and the number of categories involved. For comparing proportions between two groups, the chi square test of independence or Fisher's exact test (when expected cell counts are small) is used.[1][3] For ordinal categorical data, rank based tests preserve the ordering information: the Mann Whitney U test compares two independent groups, and the Wilcoxon signed rank test compares paired measurements.[1] For multivariable analysis (several predictors) with a categorical outcome, logistic regression (for binary outcomes), multinomial logistic regression (for three or more unordered categories) or ordinal logistic regression (for ordered categories) is appropriate.[3]

When categorical data are used as predictor variables in regression models, they must be coded numerically. Dummy coding (creating binary indicator variables for each category except a reference category) is the most common approach. Effect coding is an alternative that compares each category to the overall mean rather than to a reference category.

Measures of association for categorical data include the odds ratio (for case control studies and logistic regression), the relative risk (for cohort studies and randomized trials), and Cramér's V or the phi coefficient (for measuring the strength of association in contingency tables). Each measure has its own interpretation and appropriate context of use.

When to use it

Categorical data methods should be used whenever the variable of interest consists of discrete categories rather than continuous numerical values. This includes nominal variables (where categories have no natural order), ordinal variables (where categories are ordered but the distances between them are not meaningful or consistent), and dichotomous variables (which have only two categories). Use chi square tests for bivariate associations, logistic regression for multivariable modeling, and appropriate effect measures (odds ratio, relative risk) for quantifying the strength of associations.

Key takeaways

  • Categorical data are ubiquitous in research.
  • A frequency table lists each category and the number of observations in that category.
  • Categorical data methods should be used whenever the variable of interest consists of discrete categories rather than continuous numerical values.
  • A common error is treating categorical data as continuous, for example by assigning numbers to categories (1 = mild, 2 = moderate, 3 = severe) and then calculating means, which implies equal intervals between categories that may not exist.

Common mistakes

  • A common error is treating categorical data as continuous, for example by assigning numbers to categories (1 = mild, 2 = moderate, 3 = severe) and then calculating means, which implies equal intervals between categories that may not exist.
  • Another mistake is using the chi square test when expected cell counts are too small (conventionally, when more than 20% of cells have expected counts below 5)[1], in which case Fisher's exact test or collapsing categories is more appropriate.
  • Researchers sometimes also fail to choose an appropriate reference category in dummy coding, which can make the regression results difficult to interpret or compare with other studies. When using ordinal categorical data, ignoring the ordering and treating the data as purely nominal wastes information that could improve statistical power.[3]
  • Finally, reporting only p values for categorical associations without effect sizes (such as odds ratios or relative risks) limits the interpretability and practical significance of the findings.

Example

A clinical trial reports that 68% (136/200) of patients in the treatment group achieved a clinical response, compared to 42% (84/200) in the placebo group. A chi square test yields a test statistic of 27.3 (df = 1, p < 0.001). The relative risk of response is 1.62 (95% CI: 1.34 to 1.96), indicating that treated patients are 62% more likely to achieve a clinical response. Additionally, baseline disease severity (mild, moderate, severe) is recorded as an ordinal variable, and a logistic regression of response that includes a treatment by severity interaction term finds no evidence that the treatment benefit differs across severity categories.

Test your understanding

5 questions that adapt as you go: answer two in a row correctly and they get harder.

Question 1 of 5

Scenario:

A regression model includes blood type (A, B, AB, O) as a predictor, with type O as the reference category.

Question:

How many indicator variables does dummy coding create?

Hardness: Interpret

Sources

  1. [1]Field A. Discovering Statistics Using IBM SPSS Statistics. 6th ed. SAGE Publications, 2024. ISBN 9781529630008
  2. [2]Borenstein M, Hedges LV, Higgins JPT, Rothstein HR. Introduction to Meta-Analysis. 2nd ed. Wiley, 2021. ISBN 9781119558354
  3. [3]Agresti A. An Introduction to Categorical Data Analysis. 3rd ed. Wiley, 2019. ISBN 9781119405269

Cite this term

FullPaperguide. (2026, October 14). Categorical Data. In Paperguide Research Glossary. https://paperguide.ai/research-glossary/categorical-data/
In-text(Paperguide, 2026)

Related terms