statable Statistics for study and research

Preparing data: recode, calculate, select, merge

In brief

On the "Data" page, "Edit data" opens six assistants: Recode, Calculate, Select cases, Merge, Aggregate and Duplicate cases. Each shows a preview and the PSPP command before it is applied. The result goes into a new column; an existing column is overwritten only if that is explicitly chosen. Each step can be taken back in one go with "Undo" in the header. "Add to Commands" puts the command on the "Commands" page.

Missing values

Recode

Old values (a value, a range, "no answer", blank) are replaced by new ones; the first matching rule applies. Values without a rule are kept, left blank or set to a value. The preview counts old against new. "Reverse an item" computes new value = lowest + highest − old value, with the same rule as in scale building; the scale comes from the value labels, otherwise from the data, and can be changed. In text columns upper/lower case and leading spaces count; if values differ only in these, Statable points it out.

The "Recode" assistant also has "Form classes": a number column is divided into equally wide classes, classes with equal numbers of people, or classes with your own limits (see "Forming classes").

Calculate

A formula with columns, operators, brackets and the functions LN, EXP, SQRT, ABS and RND, or mean, sum, minimum, maximum and standard deviation across several columns. "Only if …" calculates only for cases where the condition holds; the others stay empty and are counted separately in the preview. If a divisor is 0 the result is empty, also for 0 divided by 0. The preview shows the first ten cases and counts empty results separately: missing inputs on the one hand, calculation errors (division by 0, logarithm of 0 or less, root of a negative number) on the other.

Select cases

Statable adds a selection column: 1 = condition met, 0 = not met, blank = cannot be checked because a value is missing. It can be used as a group or condition; there is deliberately no invisible filter because not every calculation in Statable would respect it. "Keep only these cases" removes the other cases for good (with a confirmation and the number) - including those that cannot be checked. Analyses in the notebook that use these data are then marked as out of date.

Merge

Aggregate

Statistics per group: cases in the group, valid values, mean, standard deviation, median, minimum, maximum, sum. Either as new columns on the data (each person gets the value of their group, row order is kept) or as a new project with one row per group; the current project stays unchanged. Cases without a group value form a group of their own. "Cases" counts all cases of the group, "valid values" only the values present in a column; a median without any valid value stays empty.

Duplicate cases

All or the chosen columns are compared (for example the ID). Cases count as equal if they match, ignoring upper/lower case and spaces at the edge (switchable to "exactly equal"); numbers are compared to 15 digits, and é as one or two characters is the same. Whether a missing value equals a missing value can be chosen. Spaces at the start of a text are lost when .sav files are opened. The result is a marker column (0 = first case, 1 = repeat); cases are deleted only on explicit choice with a confirmation.

For specialists

Related

Open in Statable