@@ -922,7 +922,7 @@ def __init__(self, control, test, effect_size,
922922 self .__random_seed = random_seed
923923 self .__ci = ci
924924 self .__alpha = ci2g ._compute_alpha_from_ci (ci )
925- self .__delta2 = delta2
925+ self .__delta2 = delta2
926926
927927 self .__difference = es .two_group_difference (
928928 control , test , is_paired , effect_size )
@@ -1187,7 +1187,9 @@ def __repr__(self, show_resample_count=True, define_pval=True, sigfig=3):
11871187 # pval_rounded)
11881188
11891189
1190- pvalue = "The p-value of the two-sided permutation t-test is {}. " .format (pval_rounded )
1190+ p1 = "The p-value of the two-sided permutation t-test is {}, " .format (pval_rounded )
1191+ p2 = "calculated for legacy purposes only. "
1192+ pvalue = p1 + p2
11911193
11921194 bs1 = "{} bootstrap samples were taken; " .format (self .__resamples )
11931195 bs2 = "the confidence interval is bias-corrected and accelerated."
@@ -1224,6 +1226,9 @@ def to_dict(self):
12241226 return out
12251227
12261228
1229+ @property
1230+ def delta2 (self ):
1231+ return self .__delta2
12271232
12281233
12291234 @property
@@ -1590,7 +1595,6 @@ def __pre_calc(self):
15901595 self .__permutation_count ,
15911596 self .__random_seed )
15921597 r_dict = result .to_dict ()
1593-
15941598 r_dict ["control" ] = cname
15951599 r_dict ["test" ] = tname
15961600 r_dict ["control_N" ] = int (len (control ))
@@ -1606,7 +1610,7 @@ def __pre_calc(self):
16061610 else :
16071611 resamp_count = False
16081612 def_pval = False
1609-
1613+
16101614 text_repr = result .__repr__ (show_resample_count = resamp_count ,
16111615 define_pval = def_pval )
16121616
@@ -1710,6 +1714,7 @@ def __calc_lqrt(self):
17101714 dat = db_obj ._plot_data
17111715 xvar = db_obj ._xvar
17121716 yvar = db_obj ._yvar
1717+ delta2 = self .__delta2
17131718
17141719
17151720 out = []
@@ -1757,7 +1762,18 @@ def __calc_lqrt(self):
17571762 "pvalue_lqrt_unequal_var" : lqrt_unequal_var_result .pvalue ,
17581763 "statistic_lqrt_unequal_var" : lqrt_unequal_var_result .statistic ,
17591764 })
1760-
1765+ if delta2 :
1766+ lqrt_result = lqrt .lqrtest_rel (self .results ["bootstraps" ][0 ],
1767+ self .results ["bootstraps" ][1 ],
1768+ random_state = rnd_seed )
1769+
1770+ out .append ({"control" : self .__experiment_label [0 ],
1771+ "test" : self .__experiment_label [1 ],
1772+ "control_N" : self .__resamples ,
1773+ "test_N" : self .__resamples ,
1774+ "pvalue_paired_lqrt" : lqrt_result .pvalue ,
1775+ "statistic_paired_lqrt" : lqrt_result .statistic
1776+ })
17611777 self .__lqrt_results = pd .DataFrame (out )
17621778
17631779
@@ -1766,7 +1782,7 @@ def plot(self, color_col=None,
17661782 raw_marker_size = 6 , es_marker_size = 9 ,
17671783
17681784 swarm_label = None , barchart_label = None , contrast_label = None , delta_label = None ,
1769- swarm_ylim = None , barchart_ylim = None , contrast_ylim = None , delta_ylim = None ,
1785+ swarm_ylim = None , barchart_ylim = None , contrast_ylim = None ,
17701786
17711787 custom_palette = None , swarm_desat = 0.5 , barchart_desat = 0.5 , halfviolin_desat = 1 ,
17721788 halfviolin_alpha = 0.8 ,
@@ -1809,7 +1825,7 @@ def plot(self, color_col=None,
18091825 `contrast_label` is not specified, it defaults to the effect size
18101826 being plotted. If `delta_label` is not specifed, it defaults to
18111827 "delta - delta"
1812- swarm_ylim, contrast_ylim, delta_ylim : tuples, default None
1828+ swarm_ylim, contrast_ylim : tuples, default None
18131829 The desired y-limits of the raw data (swarmplot) axes, the
18141830 difference axes and the delta-delta axes respectively, as a tuple. These will be autoscaled
18151831 to sensible values if they are not specified.
0 commit comments