code: def test_mfx():
      """Test the generic mixed-effects model"""
      n_samples, n_tests = 20, 100
      np.random.seed(1)
  
      # generate some data
      V1 = np.random.rand(n_samples, n_tests)
      Y = generate_data(np.ones((n_samples, 1)), 0, 1, V1)
      X = np.random.randn(20, 3)
  
      # compute the test statistics
      (t1,) = mfx_stat(
          Y,
          V1,
          X,
          1,
          return_t=True,
          return_f=False,
          return_effect=False,
          return_var=False,
      )
      assert t1.shape == (n_tests,)
      assert t1.mean() < 5 / np.sqrt(n_tests)
      assert (t1.var() < 2) and (t1.var() > 0.5)
      (t2,) = mfx_stat(Y, V1, X * np.random.rand(3), 1)
      assert_almost_equal(t1, t2)
      (f,) = mfx_stat(Y, V1, X, 1, return_t=False, return_f=True)
      assert_almost_equal(t1**2, f)
      (v2,) = mfx_stat(Y, V1, X, 1, return_t=False, return_var=True)
      assert (v2 > 0).all()
      (fx,) = mfx_stat(Y, V1, X, 1, return_t=False, return_effect=True)
      assert fx.shape == (n_tests,)
  
file_path: nipy/nipy/algorithms/statistics/tests/test_mixed_effects.py
imports: import numpy
  import numpy.random
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal
  from ..bayesian_mixed_effects import two_level_glm
  from ..mixed_effects_stat import generate_data, mfx_stat, one_sample_ftest, one_sample_ttest, t_stat, two_sample_ftest, two_sample_ttest
label_desc: Use image node_id 1 for calling a global function with example usage: test_mfx() without return types