/
You are viewing the documentation for metbit 9.0.0. Change release context

metbit.stats.univariate

Statistics and utilities module in metbit 9.0.0.

import metbit.stats.univariate

Classes

UnivarStats

Perform univariate statistical analysis and visualization using Plotly.

Parameters

dfpd.DataFrame

Input DataFrame containing the measurement and group columns.

x_colstr

Column name for the grouping variable.

y_colstr

Column name for the measurement variable.

group_orderlist of str, optional

Custom group plotting order.

custom_colorsdict of str -> str, optional

Mapping from group name to color.

stats_optionslist of str, optional
Supported["t-test", "anova", "nonparametric", "effect-size"].
p_value_thresholdfloat, default=0.05

Significance threshold.

annotate_style{'value', 'symbol'}, default='value'
Annotation stylenumeric or stars.
y_offset_factorfloat, default=0.35

Vertical spacing factor for annotations.

show_non_significantbool, default=True

Whether to display 'ns'.

correct_pstr or None, default='bonferroni'

Method for multiple testing correction. Supported: - 'bonferroni', 'holm', 'hochberg', 'hommel' - 'fdr_bh', 'fdr_by', 'fdr_tsbh', 'fdr_tsbky' - None or 'none' = no correction

title_str, optional

Plot title.

y_labelstr, optional

Y-axis label.

x_labelstr, optional

X-axis label.

fig_heightint, default=800

Figure height.

fig_widthint, default=600

Figure width.

plot_type{'box', 'violin'}, default='box'

Plot type.

show_axis_linesbool, default=True

Whether to show axis lines.

Methods

__init__(self, df: pd.DataFrame, x_col: str, y_col: str, group_order: Optional[List[str]]=None, custom_colors: Optional[Dict[str, str]]=None, stats_options: Optional[List[str]]=None, p_value_threshold: float=0.05, annotate_style: str='value', y_offset_factor: float=0.35, show_non_significant: bool=True, correct_p: Optional[str]='bonferroni', title_: Optional[str]=None, y_label: Optional[str]=None, x_label: Optional[str]=None, fig_height: int=800, fig_width: int=600, plot_type: str='box', show_axis_lines: bool=True)
compute_effsize(a, b, eftype: str='cohen')
plot(self, show_description: bool=True)
get_stats_table(self)

Return a DataFrame of statistical results.

Source

metbit/stats/univariate.py at v9.0.0
Project downloadsPyPI and GitHub measure different distribution channels. Statistics refresh daily.

Counts are distribution activity, not unique users. GitHub source archives and Git clones are not included. Sources: PyPI Stats, Pepy, ClickPy, and GitHub Releases.

metbit 9.0.0 documentation