You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
err='`idx` is not a column in `data`. Please check.'
144
-
raiseIndexError(err)
144
+
# # Check if idx is specified
145
+
# if delta2 is False and not idx:
146
+
# err = '`idx` is not a column in `data`. Please check.'
147
+
# raise IndexError(err)
145
148
146
149
147
150
# create new x & idx and record the second variable if this is a valid 2x2 ANOVA case
148
-
ifdelta2isTrue:
151
+
ifidxisNoneandxisnotNoneandyisnotNone:
149
152
# add a new column which is a combination of experiment and the first variable
150
153
new_col_name=experiment+x[0]
151
154
whilenew_col_nameindata_in.columns:
@@ -436,6 +439,28 @@ def __repr__(self):
436
439
defmean_diff(self):
437
440
"""
438
441
Returns an :py:class:`EffectSizeDataFrame` for the mean difference, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `paired` argument in `dabest.load()`.
442
+
443
+
Example
444
+
-------
445
+
>>> from scipy.stats import norm
446
+
>>> import pandas as pd
447
+
>>> import dabest
448
+
>>> control = norm.rvs(loc=0, size=30, random_state=12345)
449
+
>>> test = norm.rvs(loc=0.5, size=30, random_state=12345)
where :math:`\\overline{x}` is the mean for the group :math:`x`.
439
464
440
465
"""
441
466
returnself.__mean_diff
@@ -447,6 +472,44 @@ def median_diff(self):
447
472
Returns an :py:class:`EffectSizeDataFrame` for the median difference, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `paired` argument in `dabest.load()`.
448
473
449
474
475
+
Example
476
+
-------
477
+
>>> from scipy.stats import norm
478
+
>>> import pandas as pd
479
+
>>> import dabest
480
+
>>> control = norm.rvs(loc=0, size=30, random_state=12345)
481
+
>>> test = norm.rvs(loc=0.5, size=30, random_state=12345)
Using median difference as the statistic in bootstrapping may result in a biased estimate and cause problems with BCa confidence intervals. Consider using mean difference instead.
508
+
509
+
When plotting, consider using percentile confidence intervals instead of BCa confidence intervals by specifying `ci_type = 'percentile'` in .plot().
510
+
511
+
For detailed information, please refer to `Issue 129 <https://github.com/ACCLAB/DABEST-python/issues/129>`_.
512
+
450
513
"""
451
514
returnself.__median_diff
452
515
@@ -456,6 +519,59 @@ def cohens_d(self):
456
519
"""
457
520
Returns an :py:class:`EffectSizeDataFrame` for the standardized mean difference Cohen's `d`, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `paired` argument in `dabest.load()`.
458
521
522
+
Example
523
+
-------
524
+
>>> from scipy.stats import norm
525
+
>>> import pandas as pd
526
+
>>> import dabest
527
+
>>> control = norm.rvs(loc=0, size=30, random_state=12345)
528
+
>>> test = norm.rvs(loc=0.5, size=30, random_state=12345)
Returns an :py:class:`EffectSizeDataFrame` for the standardized mean difference Cohen's `h`, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `directional` argument in `dabest.load()`.
467
583
584
+
Example
585
+
-------
586
+
>>> from scipy.stats import randint
587
+
>>> import pandas as pd
588
+
>>> import dabest
589
+
>>> control = randint.rvs(0, 2, size=30, random_state=12345)
590
+
>>> test = randint.rvs(0, 2, size=30, random_state=12345)
Cohen's *h* uses the information of proportion in the control and test groups to calculate the distance between two proportions.
599
+
It can be used to describe the difference between two proportions as "small", "medium", or "large".
600
+
It can be used to determine if the difference between two proportions is "meaningful".
601
+
602
+
A directional Cohen's *h* is computed with the following equation:
603
+
604
+
.. math::
605
+
h = 2 * \\arcsin{\\sqrt{proportion_{Test}}} - 2 * \\arcsin{\\sqrt{proportion_{Control}}}
606
+
607
+
For a non-directional Cohen's *h*, the equation is:
608
+
609
+
.. math::
610
+
h = |2 * \\arcsin{\\sqrt{proportion_{Test}}} - 2 * \\arcsin{\\sqrt{proportion_{Control}}}|
611
+
612
+
References:
613
+
https://en.wikipedia.org/wiki/Cohen%27s_h
468
614
469
615
"""
470
616
returnself.__cohens_h
@@ -475,6 +621,39 @@ def hedges_g(self):
475
621
"""
476
622
Returns an :py:class:`EffectSizeDataFrame` for the standardized mean difference Hedges' `g`, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `paired` argument in `dabest.load()`.
477
623
624
+
625
+
Example
626
+
-------
627
+
>>> from scipy.stats import norm
628
+
>>> import pandas as pd
629
+
>>> import dabest
630
+
>>> control = norm.rvs(loc=0, size=30, random_state=12345)
631
+
>>> test = norm.rvs(loc=0.5, size=30, random_state=12345)
Returns an :py:class:`EffectSizeDataFrame` for Cliff's delta, its confidence interval, and relevant statistics, for all comparisons as indicated via the `idx` and `paired` argument in `dabest.load()`.
666
+
667
+
668
+
Example
669
+
-------
670
+
>>> from scipy.stats import norm
671
+
>>> import pandas as pd
672
+
>>> import dabest
673
+
>>> control = norm.rvs(loc=0, size=30, random_state=12345)
674
+
>>> test = norm.rvs(loc=0.5, size=30, random_state=12345)
where :math:`\\#` denotes the number of times a value from the test sample exceeds (or is lesser than) values in the control sample.
691
+
692
+
Cliff's delta ranges from -1 to 1; it can also be thought of as a measure of the degree of overlap between the two samples. An attractive aspect of this effect size is that it does not make an assumptions about the underlying distributions that the samples were drawn from.
0 commit comments