class_docstr: Test nonparametric.py.
docstr: Test function mwu
docstr_tok: ["Test","function","mwu"]
code: def test_mwu(self):
      """Test function mwu"""
      mwu_scp = scipy.stats.mannwhitneyu(
          x, y, use_continuity=True, alternative="two-sided"
      )
      mwu_pg = mwu(x, y, alternative="two-sided")
      mwu_pg_less = mwu(x, y, alternative="less")
      mwu_pg_greater = mwu(x, y, alternative="greater")
      # Similar to R: wilcox.test(df$x, df$y, paired = FALSE, exact = FALSE)
      # Note that the RBC value are compared to JASP in test_pairwise.py
      assert mwu_scp[0] == mwu_pg.at["MWU", "U-val"]
      assert mwu_scp[1] == mwu_pg.at["MWU", "p-val"]
      # One-sided
      assert (
          mwu_pg_less.at["MWU", "p-val"]
          == scipy.stats.mannwhitneyu(
              x, y, use_continuity=True, alternative="less"
          )[1]
      )
      # CLES is compared to:
      # https://janhove.github.io/reporting/2016/11/16/common-language-effect-sizes
      assert round(mwu_pg.at["MWU", "CLES"], 4) == 0.5363
      assert round(mwu_pg_less.at["MWU", "CLES"], 4) == 0.4637
      assert round(mwu_pg_greater.at["MWU", "CLES"], 4) == 0.5363
      with pytest.raises(ValueError):
          mwu(x, y, tail="error")
  
file_path: pingouin/pingouin/tests/test_nonparametric.py
imports: import pytest
  import scipy
  import numpy
  import pandas
  from unittest import TestCase
  from pingouin.nonparametric import mad, madmedianrule, mwu, wilcoxon, kruskal, friedman, cochran, harrelldavis
label_desc: Use image node_id 3 for calling the TestNonParametric obj's underlying member method code with example usage: obj.test_mwu() without return types