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 descriptiveStatTests
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:
mannwhitneyu
see scipy documentation.ttest
see statsmodels documentation.ztest
see statsmodels documentation.ks_2samp
see scipy documentation.chi2_contingency
see scipy documentation.fisher_exact
see scipy documentation.
- 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.
Eventstream#
- Eventstream.stattests(test, groups, func, group_names=('group_1', 'group_2'), 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.