@@ -325,7 +325,8 @@ def __init__(self, control, test, effect_size,
325325
326326 Parameters
327327 ----------
328- control, test : array-like
328+ control : array-like
329+ test : array-like
329330 These should be numerical iterables.
330331 effect_size : string.
331332 Any one of the following are accepted inputs:
@@ -344,9 +345,43 @@ def __init__(self, control, test, effect_size,
344345
345346 Returns
346347 -------
347- A `TwoGroupEffectSize` object.
348-
349-
348+ A :py:class:`TwoGroupEffectSize` object.
349+
350+ difference : float
351+ The effect size of the difference between the control and the test.
352+
353+ effect_size : string
354+ The type of effect size reported.
355+
356+ is_paired : boolean
357+ Whether or not the difference is paired (ie. repeated measures).
358+
359+ ci : float
360+ Returns the width of the confidence interval, in percent.
361+
362+ alpha : float
363+ Returns the significance level of the statistical test as a float
364+ between 0 and 1.
365+
366+ resamples : int
367+ The number of resamples performed during the bootstrap procedure.
368+
369+ bootstraps : nmupy ndarray
370+ The generated bootstraps of the effect size.
371+
372+ random_seed : int
373+ The number used to initialise the numpy random seed generator, ie.
374+ `seed_value` from `numpy.random.seed(seed_value)` is returned.
375+
376+ bca_low, bca_high : float
377+ The bias-corrected and accelerated confidence interval lower limit
378+ and upper limits, respectively.
379+
380+ pct_low, pct_high : float
381+ The percentile confidence interval lower limit and upper limits,
382+ respectively.
383+
384+
350385 Examples
351386 --------
352387 >>> import numpy as np
@@ -360,6 +395,36 @@ def __init__(self, control, test, effect_size,
360395 The unpaired mean difference is -0.253 [95%CI -0.782, 0.241]
361396 5000 bootstrap samples. The confidence interval is bias-corrected
362397 and accelerated.
398+ >>> effsize.to_dict()
399+ {'alpha': 0.05,
400+ 'bca_high': 0.2413346581369784,
401+ 'bca_interval_idx': (109, 4858),
402+ 'bca_low': -0.7818088458343655,
403+ 'bootstraps': array([-1.09875628, -1.08840014, -1.08258695, ..., 0.66675324,
404+ 0.75814087, 0.80848265]),
405+ 'ci': 95,
406+ 'difference': -0.25315417702752846,
407+ 'effect_size': 'mean difference',
408+ 'is_paired': False,
409+ 'pct_high': 0.25135646125431527,
410+ 'pct_interval_idx': (125, 4875),
411+ 'pct_low': -0.763588353717278,
412+ 'pvalue_brunner_munzel': nan,
413+ 'pvalue_kruskal': nan,
414+ 'pvalue_mann_whitney': 0.2600723060808019,
415+ 'pvalue_paired_students_t': nan,
416+ 'pvalue_students_t': 0.34743913903372836,
417+ 'pvalue_welch': 0.3474493875548965,
418+ 'pvalue_wilcoxon': nan,
419+ 'random_seed': 12345,
420+ 'resamples': 5000,
421+ 'statistic_brunner_munzel': nan,
422+ 'statistic_kruskal': nan,
423+ 'statistic_mann_whitney': 406.0,
424+ 'statistic_paired_students_t': nan,
425+ 'statistic_students_t': 0.9472545159069105,
426+ 'statistic_welch': 0.9472545159069105,
427+ 'statistic_wilcoxon': nan}
363428 """
364429
365430 from numpy import array , isnan
@@ -532,7 +597,8 @@ def __init__(self, control, test, effect_size,
532597 # Mann-Whitney test: Non parametric,
533598 # does not assume normality of distributions
534599 try :
535- mann_whitney = spstats .mannwhitneyu (control , test )
600+ mann_whitney = spstats .mannwhitneyu (control , test ,
601+ alternative = 'two-sided' )
536602 self .__pvalue_mann_whitney = mann_whitney .pvalue
537603 self .__statistic_mann_whitney = mann_whitney .statistic
538604 except ValueError :
0 commit comments