Skip to content

Commit 42a2de5

Browse files
committed
add LqRT tests
1 parent ccbdd51 commit 42a2de5

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

dabest/tests/test_01_effsizes_pvals.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66

77
import sys
8+
import pytest
9+
import lqrt
810
import numpy as np
911
import scipy as sp
10-
import pytest
1112
import pandas as pd
1213
from .._stats_tools import effsize
1314
from .._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)

0 commit comments

Comments
 (0)