How do I repeat my analysis with new data? (template and log of data changes)
In brief
How do I repeat my analysis with a new file? The log records every change to the data, with a checksum (SHA-256) of the file. A template records the steps and analyses of a project, without data. A new file with the same columns then runs through again.
How it works in Statable
- On the "Log" page choose the button "Save template". The file ends with ".statable-vorlage" and contains no data.
- Open the new file, choose "Choose template" on the "Log" page and select the file.
- Statable first checks whether the template fits. Then the steps run in order, and the log shows what happened.
The log
On the "Log" page each step shows: number, type, columns, number of rows affected, rows before and after, time, source (by hand or from a template) and a note. This applies to every change in the project, not only to templates.
- The log is never deleted and never edited. If a step is undone, it stays listed with the note "undone".
- It contains no values from the data, only what you entered yourself as a rule.
- For the opened file the checksum (SHA-256) is shown. It changes with any change to the file; anyone with the same file gets the same checksum. This way it can be shown later which file was used.
- "Save as CSV" saves the log as a table. In the report it can be added as an appendix. It belongs to the project file. Older projects still load; their log begins with this version of Statable, and it says so.
Save a template
On the "Log" page choose the "Save template" button. A file ending in ".statable-vorlage" is created. It contains all data changes in order and all analysis pages, but no data, no rows and no values. Column names, labels and settings are in it.
What can be repeated and what cannot
Some steps cannot be repeated on other data. Statable names them when saving, with number and reason. A template with such steps cannot be applied.
- The step refers to individual rows (changing a cell, deleting or adding a row).
- It relies on values from the original data.
- It needs a second file (for example merging files).
- It contains a command that is not allowed in templates.
- It ended with an error message, built the data as a new project or is too long.
Apply a template
Open the new file, choose "Choose template" on the "Log" page and select the file. First Statable checks whether the template suits the data, before anything is changed:
- Blocked: a column is missing or has another type (number instead of text). Statable names it. If a column is missing, you can match an existing one; the match is recorded in the log. Nothing is ever skipped silently.
- Warning: a category is new that a recode does not know. Statable names the number of rows. These values stay as the step provides. You confirm this, and it is recorded in the log.
- Note: a new column in the data or a category that is missing. This stops nothing.
Then the steps run in order on the new data, with the same functions as by hand. The analyses from the template are open as tabs and calculate when you open them, or all at once in the report. If a step stops, everything after it stops, the data are as before the run, and the reason is in the log.
Warnings
- The template repeats the steps. It does not check whether they suit the new data.
- If the meaning of a column has changed, Statable does not notice.
- Sentences in the analyses refer to the new numbers. Your own notes from the old version stay unchanged and need to be checked.
For specialists
The template is a JSON file with a version number; a newer version than the app understands is rejected. A template from elsewhere counts as unsafe: it goes through the same checks as the inputs of the interface, its texts never enter R or PSPP code unchecked, and a broken file gives a sentence instead of a crash. The checksum is SHA-256 over the bytes of the file, formed in the browser with crypto.subtle; for data without a file (example, typed in, reshaped) this is stated. The run uses the same code as the data assistant, no second path.