Stattests#

Stattests Class#

class retentioneering.tooling.stattests.stattests.StatTests(eventstream)[source]#

A class for determining statistical difference between two groups of users.

Parameters:
eventstreamEventstreamType

See also

Eventstream.stattests

Call StatTests tool as an eventstream method.

Notes

See StatTests user guide for the details.

fit(test, groups, func, group_names=('group_1', 'group_2'), alpha=0.05)[source]#

Calculates the stattests internal values with the defined parameters. Applying fit method is necessary for the following usage of any visualization or descriptive StatTests methods.

Parameters:
test{‘mannwhitneyu’, ‘ttest’, ‘ztest’, ‘ks_2samp’, ‘chi2_contingency’, ‘fisher_exact’}

Test the null hypothesis that 2 independent samples are drawn from the same distribution. Supported tests are:

groupstuple of list

Must contain a tuple of two elements (g_1, g_2): g_1 and g_2 are collections of user_id`s.

funcCallable

Selected metrics. Must contain a function that takes a dataset as an argument for a single user trajectory and returns a single numerical value.

group_namestuple, default (‘group_1’, ‘group_2’)

Names for selected groups g_1 and g_2.

alphafloat, default 0.05

Selected level of significance.

plot()[source]#

Plots a barplot comparing the metric values between two groups. Should be used after fit().

Returns:
go.Figure
property params#

Returns the parameters used for the last fitting. Should be used after fit().

property values#

Returns the comprehensive results of the comparison between the two groups. Should be used after fit().

Returns:
dict

Eventstream#

Eventstream.stattests(test, groups, func, group_names, alpha=0.05)[source]#

Determine the statistical difference between the metric values in two user groups.

Parameters:
See parameters’ description

Stattests

Returns:
StatTests

A StatTest class instance fitted to the given parameters.