code: def test_MI_stat():
      # Test for MI where we know statistically what should happen. The
      # analysis model is x0 ~ x1 with standard error 1/sqrt(n) for the
      # slope parameter.  The nominal n is 1000, but half of the cases
      # have missing x1.  Then we introduce x2 that is either
      # independent of x1, or almost perfectly correlated with x1.  In
      # the first case the SE is 1/sqrt(500), in the second case the SE
      # is 1/sqrt(1000).
  
      np.random.seed(414)
      z = np.random.normal(size=(1000, 3))
      z[:, 0] += 0.5 * z[:, 1]
  
      # Control the degree to which x2 proxies for x1
      exp = [1 / np.sqrt(500), 1 / np.sqrt(1000)]
      fmi = [0.5, 0]
      for j, r in enumerate((0, 0.9999)):
          x = z.copy()
          x[:, 2] = r * x[:, 1] + np.sqrt(1 - r**2) * x[:, 2]
          x[0:500, 1] = np.nan
  
          def model_args(x):
              # Return endog, exog
              # Regress x1 on x2
              return (x[:, 0], x[:, 1])
  
          np.random.seed(2342)
          imp = BayesGaussMI(x.copy())
          mi = MI(imp, sm.OLS, model_args, nrep=100, skip=10)
          r = mi.fit()
  
          # Check the SE
          d = np.abs(r.bse[0] - exp[j]) / exp[j]
          assert d < 0.03
  
          # Check the FMI
          d = np.abs(r.fmi[0] - fmi[j])
          assert d < 0.05
  
file_path: statsmodels/statsmodels/imputation/tests/test_bayes_mi.py
imports: import numpy
  import pandas
  import statsmodels.api
  from statsmodels.imputation.bayes_mi import BayesGaussMI, MI
  from numpy.testing import assert_allclose, assert_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_MI_stat() and returns: x,  x