Next: , Previous: , Up: Dictionaries   [Contents][Index]


2.6.9 Split Variables

The user may use the SPLIT FILE command (see SPLIT FILE in PSPP Users Guide) to select a set of variables on which to split the active dataset into groups of cases to be analyzed independently in each statistical procedure. The set of split variables is stored as part of the dictionary, although the effect on data analysis is implemented by each individual statistical procedure.

Split variables may be numeric or short or long string variables.

The most useful functions for split variables are those to retrieve them. Even these functions are rarely useful directly: for the purpose of breaking cases into groups based on the values of the split variables, it is usually easier to use casegrouper_create_splits.

Function: const struct variable *const * dict_get_split_vars (const struct dictionary *dict)

Returns a pointer to an array of pointers to split variables. If and only if there are no split variables, returns a null pointer. The caller must not modify or free the returned array.

Function: size_t dict_get_n_splits (const struct dictionary *dict)

Returns the number of split variables.

The following functions are also available for working with split variables.

Function: void dict_set_split_vars (struct dictionary *dict, struct variable *const *vars, size_t cnt)

Sets dict’s split variables to the cnt variables in vars. If cnt is 0, then dict will not have any split variables. The caller retains ownership of vars.

Function: void dict_unset_split_var (struct dictionary *dict, struct variable *var)

Removes var, which must be a variable in dict, from dict’s split of split variables.


Next: File Label, Previous: Case Limit, Up: Dictionaries   [Contents][Index]