@@ -602,6 +602,12 @@ def __init__(self, control, test, effect_size,
602602 wilcoxon = spstats .wilcoxon (control , test )
603603 self .__pvalue_wilcoxon = wilcoxon .pvalue
604604 self .__statistic_wilcoxon = wilcoxon .statistic
605+
606+ lqrt_result = lqrt .lqrtest_rel (control , test ,
607+ random_state = random_seed )
608+
609+ self .__pvalue_paired_lqrt = lqrt_result .pvalue
610+ self .__statistic_paired_lqrt = lqrt_result .statistic
605611
606612 if effect_size != "median_diff" :
607613 # Paired Student's t-test.
@@ -660,19 +666,23 @@ def __init__(self, control, test, effect_size,
660666 pass
661667
662668 # Likelihood Q-Ratio test:
663- try :
664- if self .__is_paired :
665- lqrt_ratio = lqrt .lqrtest_rel (control , test )
666- else :
667- lqrt_ratio = lqrt .lqrtest_ind (control , test )
668- self .__pvalue_lqrt = lqrt_ratio .pvalue
669- self .__statistic_lqrt = lqrt_ratio .statistic
670- except ImportError :
671- # did not install necessary library to run robust lqrt statistic
672- # warnings.warn("To get")
673- pass
669+ lqrt_equal_var_result = lqrt .lqrtest_ind (control , test ,
670+ random_state = random_seed ,
671+ equal_var = True )
672+
673+ self .__pvalue_lqrt_equal_var = lqrt_equal_var_result .pvalue
674+ self .__statistic_lqrt_equal_var = lqrt_equal_var_result .statistic
675+
676+ lqrt_unequal_var_result = lqrt .lqrtest_ind (control , test ,
677+ random_state = random_seed ,
678+ equal_var = False )
679+
680+ self .__pvalue_lqrt_unequal_var = lqrt_unequal_var_result .pvalue
681+ self .__statistic_lqrt_unequal_var = lqrt_unequal_var_result .statistic
682+
674683
675684 standardized_es = es .cohens_d (control , test , is_paired = False )
685+
676686 # self.__power = power.tt_ind_solve_power(standardized_es,
677687 # len(control),
678688 # alpha=self.__alpha,
@@ -888,21 +898,6 @@ def statistic_wilcoxon(self):
888898 except AttributeError :
889899 return npnan
890900
891- @property
892- def pvalue_lqrt (self ):
893- from numpy import nan as npnan
894- try :
895- return self .__pvalue_lqrt
896- except AttributeError :
897- return npnan
898-
899- @property
900- def statistic_lqrt (self ):
901- from numpy import nan as npnan
902- try :
903- return self .__statistic_lqrt
904- except AttributeError :
905- return npnan
906901
907902
908903 @property
@@ -997,6 +992,65 @@ def statistic_mann_whitney(self):
997992
998993
999994
995+
996+ @property
997+ def pvalue_lqrt_paired (self ):
998+ from numpy import nan as npnan
999+ try :
1000+ return self .__pvalue_paired_lqrt
1001+ except AttributeError :
1002+ return npnan
1003+
1004+
1005+
1006+ @property
1007+ def statistic_lqrt_paired (self ):
1008+ from numpy import nan as npnan
1009+ try :
1010+ return self .__statistic_paired_lqrt
1011+ except AttributeError :
1012+ return npnan
1013+
1014+
1015+ @property
1016+ def pvalue_lqrt_unpaired_equal_variance (self ):
1017+ from numpy import nan as npnan
1018+ try :
1019+ return self .__pvalue_lqrt_equal_var
1020+ except AttributeError :
1021+ return npnan
1022+
1023+
1024+
1025+ @property
1026+ def statistic_lqrt_unpaired_equal_variance (self ):
1027+ from numpy import nan as npnan
1028+ try :
1029+ return self .__statistic_lqrt_equal_var
1030+ except AttributeError :
1031+ return npnan
1032+
1033+
1034+ @property
1035+ def pvalue_lqrt_unpaired_unequal_variance (self ):
1036+ from numpy import nan as npnan
1037+ try :
1038+ return self .__pvalue_lqrt_unequal_var
1039+ except AttributeError :
1040+ return npnan
1041+
1042+
1043+
1044+ @property
1045+ def statistic_lqrt_unpaired_unequal_variance (self ):
1046+ from numpy import nan as npnan
1047+ try :
1048+ return self .__statistic_lqrt_unequal_var
1049+ except AttributeError :
1050+ return npnan
1051+
1052+
1053+
10001054 # @property
10011055 # def power(self):
10021056 # from numpy import nan as npnan
@@ -1118,7 +1172,16 @@ def __pre_calc(self):
11181172 'statistic_paired_students_t' ,
11191173
11201174 'pvalue_kruskal' ,
1121- 'statistic_kruskal' ]
1175+ 'statistic_kruskal' ,
1176+
1177+ 'pvalue_lqrt_paired' ,
1178+ 'statistic_lqrt_paired' ,
1179+
1180+ 'pvalue_lqrt_unpaired_equal_variance' ,
1181+ 'statistic_lqrt_unpaired_equal_variance' ,
1182+
1183+ 'pvalue_lqrt_unpaired_unequal_variance' ,
1184+ 'statistic_lqrt_unpaired_unequal_variance' ]
11221185
11231186 self .__results = out_ .reindex (columns = columns_in_order )
11241187 self .__results .dropna (axis = "columns" , how = "all" , inplace = True )
0 commit comments