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.univariateClasses
UnivarStats
Perform univariate statistical analysis and visualization using Plotly.
Parameters
dfpd.DataFrameInput DataFrame containing the measurement and group columns.
x_colstrColumn name for the grouping variable.
y_colstrColumn name for the measurement variable.
group_orderlist of str, optionalCustom group plotting order.
custom_colorsdict of str -> str, optionalMapping from group name to color.
stats_optionslist of str, optionalSupported["t-test", "anova", "nonparametric", "effect-size"].p_value_thresholdfloat, default=0.05Significance threshold.
annotate_style{'value', 'symbol'}, default='value'Annotation stylenumeric or stars.y_offset_factorfloat, default=0.35Vertical spacing factor for annotations.
show_non_significantbool, default=TrueWhether 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, optionalPlot title.
y_labelstr, optionalY-axis label.
x_labelstr, optionalX-axis label.
fig_heightint, default=800Figure height.
fig_widthint, default=600Figure width.
plot_type{'box', 'violin'}, default='box'Plot type.
show_axis_linesbool, default=TrueWhether 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.