statannotations.stats package

Submodules

statannotations.stats.ComparisonsCorrection module

class statannotations.stats.ComparisonsCorrection.ComparisonsCorrection(method: Union[str, callable], alpha: float = 0.05, name: Optional[str] = None, method_type: Optional[int] = None, statsmodels_api: bool = True, corr_kwargs: Optional[dict] = None)

Bases: object

apply(test_result_list)
document(func)
statannotations.stats.ComparisonsCorrection.check_valid_correction_name(name)
statannotations.stats.ComparisonsCorrection.get_correction_parameters(name)
statannotations.stats.ComparisonsCorrection.get_validated_comparisons_correction(comparisons_correction)

statannotations.stats.StatResult module

class statannotations.stats.StatResult.StatResult(test_description, test_short_name, stat_str, stat, pval, alpha=0.05)

Bases: object

adjust(stat_summary)
property corrected_significance
property correction_method
property formatted_output
property is_significant
property significance_suffix

statannotations.stats.StatTest module

class statannotations.stats.StatTest.StatTest(func: Callable, test_long_name: str, test_short_name: str, stat_name: str = 'Stat', alpha: float = 0.05, *args, **kwargs)

Bases: object

static from_library(test_name: str) StatTest
property short_name
statannotations.stats.StatTest.wilcoxon(group_data1, group_data2, verbose=1, **stats_params)

This function provides the equivalent behavior from earlier versions of statannot/statannotations.

statannotations.stats.test module

statannotations.stats.test.apply_test(group_data1, group_data2, test: Optional[Union[StatTest, str]] = None, comparisons_correction: Optional[Union[ComparisonsCorrection, str]] = None, num_comparisons: int = 1, alpha: float = 0.05, **stats_params)

Get formatted result of two-sample statistical test.

Parameters:
  • group_data1 – data

  • group_data2 – data

  • test – Union[StatTest, str]: Statistical test to run. Either a StatTest instance or one of: - Brunner-Munzel - Levene - Mann-Whitney - Mann-Whitney-gt - Mann-Whitney-ls - t-test_ind - t-test_welch - t-test_paired - Wilcoxon - Kruskal

  • comparisons_correction – Union[ComparisonsCorrection, str]: (Default value = None) Method to use for multiple comparisons correction. Either a ComparisonsCorrection instance or one of (interfacing statsmodels): - Bonferroni - Holm-Bonferroni - Benjamini-Hochberg - Benjamini-Yekutieli

  • num_comparisons – int: (Default value = 1) Number of comparisons to use for multiple comparisons correction.

  • alpha – float: (Default value = 0.05) Used for pvalue interpretation in case of comparisons_correction.

  • stats_params – Additional keyword arguments to pass to the test function

statannotations.stats.utils module

statannotations.stats.utils.check_alpha(alpha)
statannotations.stats.utils.check_num_comparisons(num_comparisons)
statannotations.stats.utils.check_pvalues(p_values)
statannotations.stats.utils.get_num_comparisons(p_values, num_comparisons)
statannotations.stats.utils.return_results(results_array)

Module contents