static struct ctables_axis *ctables_axis_parse_stack (
struct ctables_axis_parse_ctx *);
-
static struct ctables_axis *
ctables_axis_parse_primary (struct ctables_axis_parse_ctx *ctx)
{
double weight)
{
/* To determine whether a case is included in a given table for a particular
- kind of summary, consider the following charts for each variable in the
- table. Only if "yes" appears for every variable for the summary is the
- case counted.
+ kind of summary, consider the following charts for the variable being
+ summarized. Only if "yes" appears is the case counted.
- Categorical variables: VALIDN COUNT TOTALN
+ Categorical variables: VALIDN other TOTALN
Valid values in included categories yes yes yes
Missing values in included categories --- yes yes
Missing values in excluded categories --- --- yes
Valid values in excluded categories --- --- ---
- Scale variables: VALIDN COUNT TOTALN
+ Scale variables: VALIDN other TOTALN
Valid value yes yes yes
Missing value --- yes yes
Missing values include both user- and system-missing. (The system-missing
value is always in an excluded category.)
+
+ One way to interpret the above table is that scale variables are like
+ categorical variables in which all values are in included categories.
*/
switch (ss->function)
{
case CTSF_TOTALN:
- s->count += weight;
- break;
-
case CTSF_areaPCT_TOTALN:
s->count += weight;
break;
case CTSF_COUNT:
- if (is_scale || is_included)
- s->count += weight;
- break;
-
case CTSF_areaPCT_COUNT:
- if (is_scale || is_included)
+ if (is_included)
s->count += weight;
break;
case CTSF_VALIDN:
- if (is_scale
- ? !is_scale_missing
- : !is_missing)
- s->count += weight;
- break;
-
case CTSF_areaPCT_VALIDN:
if (is_scale
? !is_scale_missing
const struct ctables_summary_spec_set *specs = &ss->specs[cell->sv];
const union value *value = case_data (c, specs->var);
bool is_missing = var_is_value_missing (specs->var, value);
- bool scale_missing = specs->is_scale && (is_missing || is_listwise_missing (specs, c));
+ bool is_scale_missing
+ = specs->is_scale && (is_missing || is_listwise_missing (specs, c));
for (size_t i = 0; i < specs->n; i++)
ctables_summary_add (&cell->summaries[i], &specs->specs[i], value,
- specs->is_scale, scale_missing, is_missing,
+ specs->is_scale, is_scale_missing, is_missing,
is_included, weight[specs->specs[i].weighting]);
for (enum ctables_area_type at = 0; at < N_CTATS; at++)
if (!(cell->omit_areas && (1u << at)))
{
add_weight (a->valid, weight);
- if (!scale_missing)
+ if (!is_scale_missing)
for (size_t i = 0; i < s->table->n_sum_vars; i++)
{
const struct variable *var = s->table->sum_vars[i];