Categorical Variable vs Quantitative Variable
Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.
Categorical variable
Variables and data types
A categorical variable records which group or category an individual belongs to, rather than a numerical measurement.
A categorical variable, also called a qualitative variable, records which group each observational unit belongs to. Its values are names, so the only arithmetic that means anything is counting how many units carry each name. What decides the type is what the values stand for, not what they look like: a variable stored as digits is still categorical when the digits are labels.
Take 250 shoppers, each paying one way: 150 by card, 60 by cash, 40 by phone. That is the whole summary. Three counts adding back to 250, and three proportions, , and , adding to 1. There is no mean payment method and no standard deviation of one.
The wrong sentence is "the survey stored yes as 1 and no as 2, so the mean answer is 1.4." With 100 people, 60 yes and 40 no, those codes do give . Recode yes as 0 and no as 1 and the same 100 answers give 0.4. The number moved because the labels moved and nobody changed their answer, which is exactly what it means for arithmetic on the values to be meaningless.
Ordered categories are still categorical. Small, medium and large have a real order and no measured gap between neighbors, so you can name the most common size and not an average one. One coding is the honest exception: for a two-category variable coded 0 and 1, the mean of the codes is the proportion of 1s, which is a genuine summary. That is a count in disguise, not an average of the labels.
Naming the type is topic 1.2. Tables and summary statistics for one categorical variable follow at 1.3, and its graphs at 1.4, where the bars stand apart because the axis is a list of labels rather than a number line; see histograms vs bar graphs. Unit 3, Inference for Categorical Data: Proportions, is the inference built for exactly this kind of variable.
Quantitative variable
Variables and data types
A quantitative variable records a numerical measurement or count for which arithmetic such as averaging is meaningful.
A quantitative variable, also called a numerical variable, records a number that measures an amount: how much or how many, usually with units attached. Arithmetic on the values means something because the numbers are the quantity rather than a name for it, so a total, a mean (x-bar) and a standard deviation are all defined. Quantitative variables split again into discrete ones, whose possible values can be listed, and continuous ones, whose possible values fill an interval.
Five commutes take 12, 18, 9, 25 and 16 minutes. They total 80, so minutes. The units survive the arithmetic: the answer is 16 minutes, not 16, and switching to hours divides every value and the mean by 60. Being able to say that sentence at all is the practical signature of a quantitative variable.
The wrong sentence is "I grouped the ages into 0 to 9, 10 to 19 and 20 to 29, so age is categorical now." Grouping changes the display, not the variable. The bins still sit in order on a number line at a fixed width, so the correct picture is a histogram with touching bars, and a bar graph with gaps would claim the groups were unordered labels. You can always bin a quantitative variable; you can never take the order and the spacing away from it.
The edge case is numbers that rank rather than measure. Finishing 1st, 2nd and 3rd puts runners in order, but the gap between 1st and 2nd need not match the gap between 2nd and 3rd, so an average finishing position summarizes the ranks and not the times behind them. The reverse edge is worth knowing too: a categorical variable produces quantitative summaries, since the tally in each category is itself a discrete quantitative variable, which is what count data means.
Graphs, descriptions and summary statistics for one quantitative variable are topics 1.5, 1.6 and 1.7, and Unit 4, Inference for Quantitative Data: Means, is the inference built on them.