1414"""
1515
1616
17- def two_group_difference (control , test , is_paired = False ,
17+ def two_group_difference (control , test , is_paired = None ,
1818 effect_size = "mean_diff" ):
1919 """
2020 Computes the following metrics for control and test:
@@ -33,8 +33,8 @@ def two_group_difference(control, test, is_paired=False,
3333 control, test: list, tuple, or ndarray.
3434 Accepts lists, tuples, or numpy ndarrays of numeric types.
3535
36- is_paired: boolean , default False .
37- If True , returns the paired Cohen's d.
36+ is_paired: string , default None .
37+ If not None , returns the paired Cohen's d.
3838
3939 effect_size: string, default "mean_diff"
4040 Any one of the following effect sizes:
@@ -97,8 +97,8 @@ def two_group_difference(control, test, is_paired=False,
9797 return hedges_g (control , test , is_paired )
9898
9999 elif effect_size == "cliffs_delta" :
100- if is_paired is True :
101- err1 = "`is_paired` is True ; therefore Cliff's delta is not defined."
100+ if is_paired :
101+ err1 = "`is_paired` is not None ; therefore Cliff's delta is not defined."
102102 raise ValueError (err1 )
103103 else :
104104 return cliffs_delta (control , test )
@@ -116,9 +116,9 @@ def func_difference(control, test, func, is_paired):
116116
117117 func: summary function to apply.
118118
119- is_paired: boolean .
120- If True , computes func(test - control).
121- If False , computes func(test) - func(control).
119+ is_paired: string .
120+ If not None , computes func(test - control).
121+ If None , computes func(test) - func(control).
122122
123123 Returns:
124124 --------
@@ -159,7 +159,7 @@ def func_difference(control, test, func, is_paired):
159159
160160
161161
162- def cohens_d (control , test , is_paired = False ):
162+ def cohens_d (control , test , is_paired = None ):
163163 """
164164 Computes Cohen's d for test v.s. control.
165165 See https://en.wikipedia.org/wiki/Effect_size#Cohen's_d
@@ -168,16 +168,15 @@ def cohens_d(control, test, is_paired=False):
168168 --------
169169 control, test: List, tuple, or array.
170170
171- is_paired: boolean , default False
172- If True , the paired Cohen's d is returned.
171+ is_paired: string , default None
172+ If not None , the paired Cohen's d is returned.
173173
174174 Returns
175175 -------
176176 d: float.
177- If is_paired is False , this is equivalent to:
177+ If is_paired is None , this is equivalent to:
178178 (numpy.mean(test) - numpy.mean(control)) / pooled StDev
179-
180- If is_paired is True, returns
179+ If is_paired is not None, returns
181180 (numpy.mean(test) - numpy.mean(control)) / average StDev
182181
183182 The pooled standard deviation is equal to:
@@ -290,7 +289,7 @@ def cohens_h(control, test):
290289
291290
292291
293- def hedges_g (control , test , is_paired = False ):
292+ def hedges_g (control , test , is_paired = None ):
294293 """
295294 Computes Hedges' g for for test v.s. control.
296295 It first computes Cohen's d, then calulates a correction factor based on
0 commit comments