synaptome.hypotheses¶
synaptome.hypotheses
¶
Hypothesis tests applied to questions: a registry of tests (what each needs of a question's design, its
engine function, its default effect sizes) and the runner behind q.test(...) (DESIGN.md section 6).
Test
dataclass
¶
One hypothesis test.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
answers |
tuple[str, ...]
|
The question kinds it answers ( |
designs |
tuple[str, ...]
|
|
scales |
tuple[str, ...] | None
|
Scales of the analysed values it accepts; None: those of its estimator ( |
binary |
bool | None
|
True: needs a binary outcome; False: refuses one; None: either. |
function |
callable | None
|
Pairwise: |
params |
dict
|
Further parameters and their defaults ( |
effect_sizes |
tuple[str, ...]
|
Effect sizes reported by default, computed through |
ordered_unit |
str
|
|
offset |
bool
|
Whether it takes an |
result |
str
|
The result it produces: |
min_groups |
int
|
Omnibus tests: the fewest groups they need (Friedman: 3). |
correction |
str
|
Default correction of its rows ( |
description |
str
|
|
get(name)
¶
The registry entry for name; an unknown name lists the tests.
compute_test(question, name, alternative='two-sided', offset=None, effect_sizes=None, correction=None, alpha=0.05, assume_independent=False, **params)
¶
Runs test name on question. See Question.test for the parameters.
Returns:
| Type | Description |
|---|---|
(table, method, extras): tuple
|
Pairwise: one row per pair ( |
Raises:
| Type | Description |
|---|---|
ValueError
|
When the test doesn't suit the question (kind, design, scale, binary outcome, ordered unit, number of groups) or a setting is invalid, naming what to use instead. |