Forming classes: dividing numbers into groups
In brief
Under "Edit data" → "Recode" → "Form classes", Statable divides a number column into ordered classes. The result goes into a new column; the old one stays unchanged. Before applying, the preview shows every class with its limits, number of cases and share.
Three ways
- Equal width: the range from the smallest to the largest value is cut into equally wide pieces. The outer limits are exactly the smallest and the largest value (R shifts them by 0.1% with cut(x, k)).
- Equal numbers of people: the limits are quantiles, with 4 classes the quartiles. Statable uses the type 6 quantile rule as PSPP, SPSS and the distribution card do (not type 7 as R does by default). A class limit thus matches the quartile row of the distribution.
- Your own limits: for example 18 and 25. With open ends there is one class more than limits ("up to 18", "over 18 to 25", "over 25").
Where does a value exactly on a limit belong?
Default: to the lower class ("up to 18"; the first class includes the smallest value). This matches R (cut), the default of SPSS Visual Binning and the building block "Split into groups" (up to the median). It can be switched to the upper class ("18 to under 25"), as is usual in official statistics; the last class then includes the largest value. The rule is part of every label, and the preview says how many cases lie exactly on a limit. With whole numbers such as age in years, "over 18 to 25" means 19 to 25; Statable labels with the limits and invents no numbers.
What Statable catches
- Many equal values: if quantiles coincide, Statable forms fewer classes and says so ("Statable forms 3 instead of 4 classes"). Empty or doubly labelled classes never occur.
- Blank cells and values marked as "no answer" stay blank and enter neither the limits nor a class.
- Rounding error: 0.1 + 0.2 is 0.30000000000000004 in a computer; a comparison with 0.3 still works because Statable uses a tolerance of 10⁻¹² at the limit.
- The new column is ordinal and carries the labels as value labels.
Why classify only with a reason
Classifying throws away information and power: a measurement becomes a coarse grouping, relationships look weaker, and class limits are often arbitrary. A median split in particular is rarely justified (MacCallum, Zhang, Preacher & Rucker 2002, Psychological Methods 7(1), 19-40). Classes make sense when the question requires them (age groups, a cut-off from the literature) or when a table is to be shown. Statable allows it and points this out.
For specialists
Statable produces a RECODE command (ascending ranges, the first matching rule counts, limits with a tolerance) with FORMATS, VALUE LABELS and VARIABLE LEVEL ORDINAL. Weighted quantiles (with a case weight) follow PSPP HAVERAGE. Checked against R (cut with your own limits, quantile type = 6) and the PSPP engine itself. Source: Hyndman & Fan (1996), The American Statistician 50(4), 361-365 (quantile types).