Questions¶
A question says what is compared, on which data. It holds no numbers and no choice of test.
q = study.compare("error", by="method", reference="proposed",
subset={"sensors": "eeg"}, reduce={"source": "median"}, higher_is_better=False)
| Kind | Entry point | Answered by |
|---|---|---|
Compare |
study.compare(outcome, by=...) |
pairwise and omnibus tests, normality, estimates |
CompareAlong |
study.compare_along(outcome, by=..., along=...) |
cluster permutation, estimates per coordinate |
Distribution |
study.distribution(outcome, by=None) |
normality tests, per-group estimates |
Roles¶
outcome,by(the factor),along(an ordered dimension kept whole);subset: filters on coordinates, unit ids, or variables at or above the outcome's level;reduce: how to collapse what the question doesn't use ({"source": "median"},{"trial": "mean"},{"week": "slope"}), in the order written;unit: the independent observations, a level (default: the outcome's, afterreduce) or an ordered dimension of one recording (unit="time");referenceorpairs,higher_is_better: orient the answers (positive = reference better);title,description,status.
The design is read, not declared¶
q.design reports what the question compares: paired or independent (from where by lives), the groups and
pairs, the unit, the number of units overall, per group and per pair, the scale of the analysed values.
q.data is the analysis table every test, estimate and figure reads.
Each pair keeps its own complete cases: a method missing in 5 subjects compares on 11 of them, and the other pairs keep all 16.
Guard rails¶
A question refuses, with a message naming the fix:
- levels below the unit left unreduced (pseudo-replication), dimensions it doesn't use left with several
coordinates:
reduceis never guessed; - a
unitbelow the level wherebyvaries, abystored below the unit; referenceorpairsnaming groups that don't exist aftersubset; analongthat isn't ordered.
Recording a question¶
q.to_dict() writes the question as plain data; study.question(spec) asks it again, on this study or a new
version of it. q.data_key fingerprints the data it read: the same question on the same data gives the same key,
so study.verify(result) tells whether a result still matches the study. See
tutorial 08.