Data & Measurement
Categorical Data
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).
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. 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. 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.
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), 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. 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.
Sources
- [1]Field A. Discovering Statistics Using IBM SPSS Statistics. 6th ed. SAGE Publications, 2024.
- [2]Borenstein M, Hedges LV, Higgins JPT, Rothstein HR. Introduction to Meta-Analysis. 2nd ed. Wiley, 2021.
- [3]Agresti A. An Introduction to Categorical Data Analysis. 3rd ed. Wiley, 2019.
Cite this term
Categorical Data. Paperguide Research Glossary. Paperguide, 2026. Available at: https://paperguide.ai/research-glossary/categorical-data/(Paperguide, 2026)