File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66
77import sys
8+ import pytest
9+ import lqrt
810import numpy as np
911import scipy as sp
10- import pytest
1112import pandas as pd
1213from .._stats_tools import effsize
1314from .._classes import TwoGroupsEffectSize
@@ -176,4 +177,31 @@ def test_ordinal_dominance():
176177 "cliffs_delta" , is_paired = False )
177178
178179 p1 = sp .stats .brunnermunzel (likert_control , likert_treatment ).pvalue
179- assert es .pvalue_brunner_munzel == pytest .approx (p1 )
180+ assert es .pvalue_brunner_munzel == pytest .approx (p1 )
181+
182+
183+
184+ def test_lqrt_unpaired ():
185+ es = TwoGroupsEffectSize (wellbeing .control , wellbeing .expt ,
186+ "mean_diff" , is_paired = False )
187+
188+ p1 = lqrt .lqrtest_ind (wellbeing .control , wellbeing .expt ,
189+ equal_var = False ,
190+ random_state = 12345 )
191+
192+ p2 = lqrt .lqrtest_ind (wellbeing .control , wellbeing .expt ,
193+ equal_var = True ,
194+ random_state = 12345 )
195+
196+ assert es .pvalue_lqrt_unpaired_unequal_variance == pytest .approx (p1 .pvalue )
197+ assert es .pvalue_lqrt_unpaired_equal_variance == pytest .approx (p2 .pvalue )
198+
199+
200+ def test_lqrt_paired ():
201+ es = TwoGroupsEffectSize (paired_wellbeing .pre , paired_wellbeing .post ,
202+ "mean_diff" , is_paired = True )
203+
204+ p1 = lqrt .lqrtest_rel (paired_wellbeing .pre , paired_wellbeing .post ,
205+ random_state = 12345 )
206+
207+ assert es .pvalue_lqrt_paired == pytest .approx (p1 .pvalue )
You can’t perform that action at this time.
0 commit comments