|
166 | 166 | " self.__effect_size = effect_size\n", |
167 | 167 | " self.__random_seed = random_seed\n", |
168 | 168 | " self.__ci = ci\n", |
169 | | - " self.__proportional = proportional\n", |
| 169 | + " self.__is_proportional = proportional\n", |
170 | 170 | " self._check_errors(control, test)\n", |
171 | 171 | "\n", |
172 | 172 | " # Convert to numpy arrays for speed.\n", |
|
316 | 316 | " err1 = \"`paired` is not None; therefore Cliff's delta is not defined.\"\n", |
317 | 317 | " raise ValueError(err1)\n", |
318 | 318 | "\n", |
319 | | - " if self.__proportional and self.__effect_size not in [\"mean_diff\", \"cohens_h\"]:\n", |
320 | | - " err1 = \"`proportional` is True; therefore effect size other than mean_diff and cohens_h is not defined.\" + \\\n", |
321 | | - " \"If you are calculating deltas' g, it's the same as delta-delta when `proportional` is True\"\n", |
| 319 | + " if self.__is_proportional and self.__effect_size not in [\"mean_diff\", \"cohens_h\"]:\n", |
| 320 | + " err1 = \"`is_proportional` is True; therefore effect size other than mean_diff and cohens_h is not defined.\" + \\\n", |
| 321 | + " \"If you are calculating deltas' g, it's the same as delta-delta when `is_proportional` is True\"\n", |
322 | 322 | " raise ValueError(err1)\n", |
323 | 323 | "\n", |
324 | | - " if self.__proportional and (\n", |
| 324 | + " if self.__is_proportional and (\n", |
325 | 325 | " isin(control, [0, 1]).all() == False or isin(test, [0, 1]).all() == False\n", |
326 | 326 | " ):\n", |
327 | 327 | " err1 = (\n", |
328 | | - " \"`proportional` is True; Only accept binary data consisting of 0 and 1.\"\n", |
| 328 | + " \"`is_proportional` is True; Only accept binary data consisting of 0 and 1.\"\n", |
329 | 329 | " )\n", |
330 | 330 | " raise ValueError(err1)\n", |
331 | 331 | "\n", |
|
393 | 393 | " self.__permutation_count,\n", |
394 | 394 | " )\n", |
395 | 395 | "\n", |
396 | | - " if self.__is_paired and not self.__proportional:\n", |
| 396 | + " if self.__is_paired and not self.__is_proportional:\n", |
397 | 397 | " # Wilcoxon, a non-parametric version of the paired T-test.\n", |
398 | 398 | " try:\n", |
399 | 399 | " wilcoxon = spstats.wilcoxon(self.__control, self.__test)\n", |
|
414 | 414 | " self.__pvalue_paired_students_t = paired_t.pvalue\n", |
415 | 415 | " self.__statistic_paired_students_t = paired_t.statistic\n", |
416 | 416 | "\n", |
417 | | - " elif self.__is_paired and self.__proportional:\n", |
| 417 | + " elif self.__is_paired and self.__is_proportional:\n", |
418 | 418 | " # for binary paired data, use McNemar's test\n", |
419 | 419 | " # References:\n", |
420 | 420 | " # https://en.wikipedia.org/wiki/McNemar%27s_test\n", |
|
428 | 428 | " self.__pvalue_mcnemar = _mcnemar.pvalue\n", |
429 | 429 | " self.__statistic_mcnemar = _mcnemar.statistic\n", |
430 | 430 | "\n", |
431 | | - " elif self.__proportional:\n", |
| 431 | + " elif self.__is_proportional:\n", |
432 | 432 | " # The Cohen's h calculation is for binary categorical data\n", |
433 | 433 | " try:\n", |
434 | 434 | " self.__proportional_difference = es.cohens_h(\n", |
|
604 | 604 | " return self.__is_paired\n", |
605 | 605 | "\n", |
606 | 606 | " @property\n", |
607 | | - " def proportional(self):\n", |
608 | | - " return self.__proportional\n", |
| 607 | + " def is_proportional(self):\n", |
| 608 | + " return self.__is_proportional\n", |
609 | 609 | "\n", |
610 | 610 | " @property\n", |
611 | 611 | " def ci(self):\n", |
|
1001 | 1001 | " self.__resamples = resamples\n", |
1002 | 1002 | " self.__permutation_count = permutation_count\n", |
1003 | 1003 | " self.__random_seed = random_seed\n", |
1004 | | - " self.__proportional = proportional\n", |
| 1004 | + " self.__is_proportional = proportional\n", |
1005 | 1005 | " self.__x1_level = x1_level\n", |
1006 | 1006 | " self.__experiment_label = experiment_label\n", |
1007 | 1007 | " self.__x2 = x2\n", |
|
1044 | 1044 | " self.__is_paired,\n", |
1045 | 1045 | " self.__resamples,\n", |
1046 | 1046 | " self.__random_seed,\n", |
1047 | | - " self.__proportional,\n", |
| 1047 | + " self.__is_proportional,\n", |
1048 | 1048 | " )\n", |
1049 | 1049 | "\n", |
1050 | 1050 | " for j, current_tuple in enumerate(idx):\n", |
|
1062 | 1062 | " control,\n", |
1063 | 1063 | " test,\n", |
1064 | 1064 | " self.__effect_size,\n", |
1065 | | - " self.__proportional,\n", |
| 1065 | + " self.__is_proportional,\n", |
1066 | 1066 | " self.__is_paired,\n", |
1067 | 1067 | " self.__ci,\n", |
1068 | 1068 | " self.__resamples,\n", |
|
1459 | 1459 | " passed to plot() : {'linewidth':1, 'alpha':0.5, 'jitter':0, 'jitter_seed':9876543210}.\n", |
1460 | 1460 | " sankey_kwargs: dict, default None\n", |
1461 | 1461 | " Whis will change the appearance of the sankey diagram used to depict\n", |
1462 | | - " paired proportional data when `show_pairs=True` and `proportional=True`.\n", |
| 1462 | + " paired proportional data when `show_pairs=True` and `is_proportional=True`.\n", |
1463 | 1463 | " Pass any keyword arguments accepted by plot_tools.sankeydiag() function\n", |
1464 | 1464 | " here, as a dict. If None, the following keywords are passed to sankey diagram:\n", |
1465 | 1465 | " {\"width\": 0.5, \"align\": \"center\", \"alpha\": 0.4, \"bar_width\": 0.1, \"rightColor\": False}\n", |
|
1596 | 1596 | " if self.__delta2 and not empty_circle:\n", |
1597 | 1597 | " color_col = self.__x2\n", |
1598 | 1598 | "\n", |
1599 | | - " # if self.__proportional:\n", |
1600 | | - " # raw_marker_size = 0.01\n", |
1601 | | - "\n", |
1602 | 1599 | " # Modification incurred due to update of Seaborn\n", |
1603 | 1600 | " ci = (\"ci\", ci) if ci is not None else None\n", |
1604 | 1601 | "\n", |
|
1609 | 1606 | " return out\n", |
1610 | 1607 | "\n", |
1611 | 1608 | " @property\n", |
1612 | | - " def proportional(self):\n", |
| 1609 | + " def is_proportional(self):\n", |
1613 | 1610 | " \"\"\"\n", |
1614 | 1611 | " Returns the proportional parameter\n", |
1615 | 1612 | " class.\n", |
1616 | 1613 | " \"\"\"\n", |
1617 | | - " return self.__proportional\n", |
| 1614 | + " return self.__is_proportional\n", |
1618 | 1615 | "\n", |
1619 | 1616 | " @property\n", |
1620 | 1617 | " def results(self):\n", |
|
1727 | 1724 | " \"\"\"\n", |
1728 | 1725 | " return self.__dabest_obj\n", |
1729 | 1726 | "\n", |
1730 | | - " @property\n", |
1731 | | - " def proportional(self):\n", |
1732 | | - " \"\"\"\n", |
1733 | | - " Returns the proportional parameter\n", |
1734 | | - " class.\n", |
1735 | | - " \"\"\"\n", |
1736 | | - " return self.__proportional\n", |
1737 | 1727 | "\n", |
1738 | 1728 | " @property\n", |
1739 | 1729 | " def lqrt(self):\n", |
|
0 commit comments