Skip to content

Compare group peak times

Question

Do independent groups peak at different clock times?

See every package-generated example · Read the complete analysis pipeline

When to use

Use this to compare scored clock phases across independent groups.

Example figure

Compare group peak times output generated by Circadian Workbench

This deterministic example is calculated by the phase_comparison action and drawn by render_phase_comparison_svg, the same renderer used for publication export. Empty or withheld elements are therefore visible exactly as they are in a real result.

import circadian_workbench as cw

cw.call("phase_comparison", phases=phases)

Required inputs and controls

The public function is the registered action below. settings= is accepted as a friendlier alias for config= by cw.call; the calculation stores the complete normalized config in provenance.

Function reference

cw.call("phase_comparison", phases, config=None, period_hours=None)

Arguments and parameters

Name Type Required Default Units Meaning
phases object yes — hours Phase values grouped by label: {'WT': [6.1, 5.8, ...], 'KO': [...]}. These are phases the caller already has -- onset hours from daily_measures, phase_hours from estimate_period, or their own scoring. This action does not compute phases, so the numbers may come from anywhere as long as they are clock hours on one shared period.
config object no null - Partial scientific settings. Omitted or None values use the shared installed defaults; invalid fresh values are rejected. Run describe_config for names, meanings, units, bounds and choices. Explicitly load old saved mappings with load_saved_settings to report compatibility conversions.
period_hours float no null hours The cycle the phases live on. Omit to use the config's period_hours (24 h by default). A free-running cohort should pass its own tau, so that 'one cycle' means one of the animals' cycles rather than one solar day. splitting uses it for a second purpose that is the same idea: the period the resolution element P**2/T is worked out at, which sets how far apart two components must be before that record can show them to differ.

Every nested config key, default, allowed value, and purpose is listed in the complete configuration reference.

How it works

Each group's circular mean is estimated and groups are compared with a circular test.

$$ \Delta\phi=\operatorname{wrap}(\bar\phi_B-\bar\phi_A) $$

Implementation: circular.py::phase_comparison.

Outputs and interpretation

The result reports group means, concentration, phase difference and inferential evidence.

cw.call returns a Result: use .data for calculated values, .warnings for scientific qualifications, .provenance for version and input identity, .script for an equivalent replay script, and .files for saved outputs.

Limitations

All groups must use the same phase reference and period.

Example

The figure above is a real package result from a seeded, redistributable synthetic dataset. The flat gallery bundle retains figure_data_compare-group-phases.csv, a standalone plot_compare-group-phases.py, source hashes, an editable SVG, and a rendered preview.

Methods text

Group phase distributions were summarized and compared with a circular test.

See also

Compare group rhythms · Compare fitted group rhythms · Analysis index · Gallery