yasa.SleepStatsAgreement.assumptions#

property SleepStatsAgreement.assumptions[source]#

A pandas.DataFrame with the results of the statistical assumption tests for each sleep statistic. Columns form a MultiIndex with levels assumption and metric:

  • unbiased — one-sample t-test of the differences against zero: t, pvalue, cohen_d (mean difference divided by its SD) and passed.

  • normal — Shapiro-Wilk test of the differences: W, pvalue, sample skew, excess kurtosis, passed and the confidence-interval method ('param' if passed, 'boot' otherwise).

  • constant_bias — regression of the differences on the reference values: slope, pvalue, r2, passed and the bias method ('param' if passed, 'regr' otherwise).

  • homoscedastic — regression of the absolute residuals of the bias regression on the reference values: slope, pvalue, r2, sd_ratio (ratio of the fitted absolute residuals at the upper and lower ends of the observed reference range), passed and the limits-of-agreement method ('param' if passed, 'regr' otherwise, 'log' for log-transformed statistics when log_transform=True).

method is what report, summary, calibrate and plot_blandaltman apply when 'auto' is requested.

passed is True when pvalue >= alpha for the unbiased assumption. The three assumptions that drive the automatic method selection use a dual criterion instead: they only fail when pvalue < alpha and the effect size exceeds the corresponding threshold in effect_size_gates (skew/kurtosis for normal, r2 for constant_bias, sd_ratio for homoscedastic). This prevents a statistically detectable but practically negligible deviation from switching methods in large samples.

Changed in version 0.8.0: Includes the test statistics, effect sizes and selected methods (previously only the pass/fail flags), and gates passed on the effect sizes.