@@ -143,6 +143,11 @@ def __init__(self, data, idx, x, y, paired, id_col, ci, resamples,
143143 value_vars = all_plot_groups ,
144144 value_name = self .__yvar ,
145145 var_name = self .__xvar )
146+
147+ # Added in v0.2.7.
148+ # remove any NA rows.
149+ plot_data .dropna (axis = 0 , how = 'any' , subset = [self .__yvar ], inplace = True )
150+
146151
147152 # Lines 131 to 140 added in v0.2.3.
148153 # Fixes a bug that jammed up when the xvar column was already
@@ -444,6 +449,9 @@ def __init__(self, control, test, effect_size,
444449 'pct_low': -0.763588353717278,
445450 'pvalue_brunner_munzel': nan,
446451 'pvalue_kruskal': nan,
452+ 'pvalue_lqrt_paired': nan,
453+ 'pvalue_lqrt_unpaired_equal_variance': 0.36,
454+ 'pvalue_lqrt_unpaired_unequal_variance': 0.36,
447455 'pvalue_mann_whitney': 0.2600723060808019,
448456 'pvalue_paired_students_t': nan,
449457 'pvalue_students_t': 0.34743913903372836,
@@ -453,6 +461,9 @@ def __init__(self, control, test, effect_size,
453461 'resamples': 5000,
454462 'statistic_brunner_munzel': nan,
455463 'statistic_kruskal': nan,
464+ 'statistic_lqrt_paired': nan,
465+ 'statistic_lqrt_unpaired_equal_variance': 0.8894980773231964,
466+ 'statistic_lqrt_unpaired_unequal_variance': 0.8916901409507432,
456467 'statistic_mann_whitney': 406.0,
457468 'statistic_paired_students_t': nan,
458469 'statistic_students_t': 0.9472545159069105,
@@ -465,6 +476,7 @@ def __init__(self, control, test, effect_size,
465476 from numpy .random import choice , seed
466477
467478 import scipy .stats as spstats
479+ import lqrt
468480
469481 # import statsmodels.stats.power as power
470482
@@ -596,6 +608,12 @@ def __init__(self, control, test, effect_size,
596608 wilcoxon = spstats .wilcoxon (control , test )
597609 self .__pvalue_wilcoxon = wilcoxon .pvalue
598610 self .__statistic_wilcoxon = wilcoxon .statistic
611+
612+ lqrt_result = lqrt .lqrtest_rel (control , test ,
613+ random_state = random_seed )
614+
615+ self .__pvalue_paired_lqrt = lqrt_result .pvalue
616+ self .__statistic_paired_lqrt = lqrt_result .statistic
599617
600618 if effect_size != "median_diff" :
601619 # Paired Student's t-test.
@@ -653,7 +671,24 @@ def __init__(self, control, test, effect_size,
653671 # in terms of rank (eg. all zeros.)
654672 pass
655673
674+ # Likelihood Q-Ratio test:
675+ lqrt_equal_var_result = lqrt .lqrtest_ind (control , test ,
676+ random_state = random_seed ,
677+ equal_var = True )
678+
679+ self .__pvalue_lqrt_equal_var = lqrt_equal_var_result .pvalue
680+ self .__statistic_lqrt_equal_var = lqrt_equal_var_result .statistic
681+
682+ lqrt_unequal_var_result = lqrt .lqrtest_ind (control , test ,
683+ random_state = random_seed ,
684+ equal_var = False )
685+
686+ self .__pvalue_lqrt_unequal_var = lqrt_unequal_var_result .pvalue
687+ self .__statistic_lqrt_unequal_var = lqrt_unequal_var_result .statistic
688+
689+
656690 standardized_es = es .cohens_d (control , test , is_paired = False )
691+
657692 # self.__power = power.tt_ind_solve_power(standardized_es,
658693 # len(control),
659694 # alpha=self.__alpha,
@@ -963,6 +998,65 @@ def statistic_mann_whitney(self):
963998
964999
9651000
1001+
1002+ @property
1003+ def pvalue_lqrt_paired (self ):
1004+ from numpy import nan as npnan
1005+ try :
1006+ return self .__pvalue_paired_lqrt
1007+ except AttributeError :
1008+ return npnan
1009+
1010+
1011+
1012+ @property
1013+ def statistic_lqrt_paired (self ):
1014+ from numpy import nan as npnan
1015+ try :
1016+ return self .__statistic_paired_lqrt
1017+ except AttributeError :
1018+ return npnan
1019+
1020+
1021+ @property
1022+ def pvalue_lqrt_unpaired_equal_variance (self ):
1023+ from numpy import nan as npnan
1024+ try :
1025+ return self .__pvalue_lqrt_equal_var
1026+ except AttributeError :
1027+ return npnan
1028+
1029+
1030+
1031+ @property
1032+ def statistic_lqrt_unpaired_equal_variance (self ):
1033+ from numpy import nan as npnan
1034+ try :
1035+ return self .__statistic_lqrt_equal_var
1036+ except AttributeError :
1037+ return npnan
1038+
1039+
1040+ @property
1041+ def pvalue_lqrt_unpaired_unequal_variance (self ):
1042+ from numpy import nan as npnan
1043+ try :
1044+ return self .__pvalue_lqrt_unequal_var
1045+ except AttributeError :
1046+ return npnan
1047+
1048+
1049+
1050+ @property
1051+ def statistic_lqrt_unpaired_unequal_variance (self ):
1052+ from numpy import nan as npnan
1053+ try :
1054+ return self .__statistic_lqrt_unequal_var
1055+ except AttributeError :
1056+ return npnan
1057+
1058+
1059+
9661060 # @property
9671061 # def power(self):
9681062 # from numpy import nan as npnan
@@ -1084,7 +1178,16 @@ def __pre_calc(self):
10841178 'statistic_paired_students_t' ,
10851179
10861180 'pvalue_kruskal' ,
1087- 'statistic_kruskal' ]
1181+ 'statistic_kruskal' ,
1182+
1183+ 'pvalue_lqrt_paired' ,
1184+ 'statistic_lqrt_paired' ,
1185+
1186+ 'pvalue_lqrt_unpaired_equal_variance' ,
1187+ 'statistic_lqrt_unpaired_equal_variance' ,
1188+
1189+ 'pvalue_lqrt_unpaired_unequal_variance' ,
1190+ 'statistic_lqrt_unpaired_unequal_variance' ]
10881191
10891192 self .__results = out_ .reindex (columns = columns_in_order )
10901193 self .__results .dropna (axis = "columns" , how = "all" , inplace = True )
@@ -1204,6 +1307,12 @@ def plot(self, color_col=None,
12041307 pyplot.violinplot` command here, as a dict. If None, the following
12051308 keywords are passed to violinplot : {'widths':0.5, 'vert':True,
12061309 'showextrema':False, 'showmedians':False}.
1310+ slopegraph_kwargs : dict, default None
1311+ This will change the appearance of the lines used to join each pair
1312+ of observations when `show_pairs=True`. Pass any keyword arguments
1313+ accepted by matplotlib `plot()` function here, as a dict.
1314+ If None, the following keywords are
1315+ passed to plot() : {'linewidth':1, 'alpha':0.5}.
12071316 reflines_kwargs : dict, default None
12081317 This will change the appearance of the zero reference lines. Pass
12091318 any keyword arguments accepted by the matplotlib Axes `hlines`
0 commit comments