CTABLES: Make EMPTY independent of other settings on CATEGORIES.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 24 Nov 2022 00:39:35 +0000 (16:39 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 24 Nov 2022 00:42:48 +0000 (16:42 -0800)
commit52a9e73448f45fdc70f9ab7508744cefb291a7b7
treef5ac251b5960d2bca9fea73f2fe8e4d2ab126a49
parent2f3f4d9b20e0cde593fad4137cdc48922a38c3da
CTABLES: Make EMPTY independent of other settings on CATEGORIES.

Frans Houweling reported that the following two commands behave
differently:

   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
      /CATEGORIES VARIABLES=size TOTAL=YES.
   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=size TOTAL=YES
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.

There was a good reason for this, which is that CATEGORIES always changes
all the category attributes of whatever variables are named.  That is,
CATEGORIES VARIABLES=ALL overrides TOTAL even if EMPTY is the only
subcommand given.  I don't know what SPSS does here, but this behavior is
surprising enough that I wanted to change it.  This commit does that;
afterward, both of the above commands behave the same way, which
combines effects of TOTAL=YES and EMPTY=EXCLUDE for size and just
EMPTY=EXCLUDE for the class and datum.
src/language/stats/ctables.c
tests/language/stats/ctables.at