Ordinal variable

By Jude Wallis · Updated

An ordinal variable is a categorical variable whose categories have a meaningful order, but with no fixed numeric distance between them.

An ordinal variable orders its categories without spacing them. You can say good outranks fair and fair outranks poor. You cannot say the step from fair to good is the same size as the step from good to excellent, because nothing in the data measured either step. That one missing fact decides which summaries are legitimate. The mode, the median category and percentiles are all reportable: the mode needs only counts, and the other two need only the ordering. The mean and the standard deviation are not.

Assigning codes does not supply the missing distances. Nine customers rate store A and nine rate store B on very poor, poor, fair, good, excellent. All nine of A's say good. B splits: five say very poor, four say excellent. Code the categories 1 through 5 and A averages 36/9=4.0036 / 9 = 4.00 against B's 25/9=2.7825 / 9 = 2.78, so A wins. Code them 1, 2, 3, 4, 10, which respects the same order, and A still averages 4.00 while B averages 45/9=5.0045 / 9 = 5.00, so B wins. The ratings never changed. Only the numbers someone picked for the labels did.

"Average satisfaction was 4.2 out of 5." That is an average of codes, not of anything measured, and the reversal above is what it risks. The medians do not budge: A's median is good and B's is very poor under every order-preserving coding you could write down. That stability is the whole reason the median is the defensible center here.

Averaging ordinal codes is routine in survey work anyway, and the honest version states the assumption out loud: the steps are being treated as equal in size. If you can establish equal spacing, say because the categories are ranges of a measured quantity, the variable was quantitative all along and the mean comes back. Order also fixes the display: unlike a nominal variable, an ordinal one keeps its categories in sequence.

The Fall 2026 AP Statistics framework does not use the word ordinal; both kinds count simply as categorical variables there.

More variables and data types terms, or browse the full statistics glossary.