yasa.SleepStatsAgreement.summary#

SleepStatsAgreement.summary(ci_method='auto', sleep_stats=None)[source]#

Return a DataFrame that includes all calculated metrics:

  • Parametric bias

  • Parametric lower and upper limits of agreement

  • Half-width of the constant limits of agreement around the regression bias line, i.e. 1.96 × SD of the bias-regression residuals (Menghini et al. 2021, eq. 2)

  • Regression intercept and slope for modeled bias

  • Regression intercept and slope for modeled limits of agreement

  • Euser et al. (2008) slope for log-transformed limits of agreement (only when log_transform=True)

  • Lower and upper confidence intervals for all metrics

Parameters:
ci_methodstr or None

If 'param' (i.e., parametric), confidence intervals are always represented using a standard t-distribution. If 'boot' (i.e., bootstrap), confidence intervals are always represented using a bootstrap resampling procedure. If 'auto' (default), confidence intervals are represented using a bootstrap resampling procedure for sleep statistics where the distribution of score differences is non-normal and using a standard t-distribution otherwise. If None, no confidence intervals are computed and only the 'center' interval is returned. This avoids the (potentially slow) bootstrap procedure entirely.

sleep_statslist or None

List of sleep statistics to include, in the desired row order. Default (None) is to include all sleep statistics. Bootstrapped confidence intervals are only computed for the requested statistics.

Added in version 0.8.0.

Returns:
summarypandas.DataFrame

A DataFrame of numeric bias, limits of agreement, and their confidence intervals for all sleep statistics. Columns form a MultiIndex with levels variable and interval ('center', 'lower', 'upper').

When log_transform=True, an additional loa_log_slope variable holds the Euser (2008) LoA slope (LoA = bias ± slope × ref) and its confidence interval.