Recognizing and summarizing categorical data
A categorical variable records which named class an observation belongs to. Its labels may be words or number codes, but the analysis should follow what those labels mean. Identify whether the classes have a meaningful order before choosing a summary or display.
Types of categories
Nominal categories have no intrinsic order: eye colors are classes, not positions on a scale. Ordinal categories have a meaningful order, as with satisfaction from poor to excellent, but that order alone does not establish equal distances between adjacent levels.
A number can still be only an identifier; room 101 is a location label rather than a measured magnitude.
Ordered categories can be ranked, and their cumulative proportions can describe the share at or below each level. The difference between two rank codes, however, is not automatically a measured distance. Ask what the recorded values represent before using numerical operations on them.
Summarizing and displaying
A frequency is a count in a category. A proportion divides that count by the relevant denominator; if the question concerns recorded responses, count the nonmissing responses and state the missing-data rule. The mode is the most frequent category and is meaningful for both nominal and ordinal data.
A bar chart uses separate bars for category counts or proportions. To compare category shares across years, show the shares within each year and label each year's denominator; year may index the groups on an axis while the response remains categorical.
A pie chart can show parts of one whole when its categories are mutually exclusive and exhaustive.
Worked example
Suppose 20 people give a recorded eye-color response and 9 report blue. Blue has frequency 9 and proportion 9 divided by 20, or 45%. If additional people did not respond, report that separately: they are not part of the denominator for the share among recorded responses.
A clinic records treatment choice for 80 patients: 30 choose A, 18 choose B, 22 choose C, and 10 do not respond. Among patients with a recorded choice, what proportion choose A?
A university reports the percentage of students selecting each of three commuting modes in each calendar year. Which display retains both category and year information?