yasa.SleepStatsAgreement.assumptions#
- property SleepStatsAgreement.assumptions[source]#
A
pandas.DataFramewith the results of the statistical assumption tests for each sleep statistic. Columns form a MultiIndex with levelsassumptionandmetric:unbiased— one-sample t-test of the differences against zero:t,pvalue,cohen_d(mean difference divided by its SD) andpassed.normal— Shapiro-Wilk test of the differences:W,pvalue, sampleskew, excesskurtosis,passedand the confidence-intervalmethod('param'if passed,'boot'otherwise).constant_bias— regression of the differences on the reference values:slope,pvalue,r2,passedand the biasmethod('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),passedand the limits-of-agreementmethod('param'if passed,'regr'otherwise,'log'for log-transformed statistics whenlog_transform=True).
methodis whatreport,summary,calibrateandplot_blandaltmanapply when'auto'is requested.passedisTruewhenpvalue >= alphafor theunbiasedassumption. The three assumptions that drive the automatic method selection use a dual criterion instead: they only fail whenpvalue < alphaand the effect size exceeds the corresponding threshold ineffect_size_gates(skew/kurtosisfornormal,r2forconstant_bias,sd_ratioforhomoscedastic). 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
passedon the effect sizes.