code: def anova_oneway(y, x, seq=0):
      # new version to match NIST
      # no generalization or checking of arguments, tested only for 1d
      yrvs = y[:, np.newaxis]  # - min(y)
      # subracting mean increases numerical accuracy for NIST test data sets
      xrvs = (
          x[:, np.newaxis] - x.mean()
      )  # for 1d#- 1e12  trick for 'SmLs09.dat'
  
      from .try_catdata import groupsstats_dummy
  
      meang, varg, xdevmeangr, countg = groupsstats_dummy(
          yrvs[:, :1], xrvs[:, :1]
      )
      # TODO: the following does not work as replacement
      #  from .try_catdata import groupsstats_dummy, groupstatsbin
      #  gcount, gmean , meanarr, withinvar, withinvararr = groupstatsbin(y, x)
      sswn = np.dot(xdevmeangr.T, xdevmeangr)
      ssbn = np.dot((meang - xrvs.mean()) ** 2, countg.T)
      nobs = yrvs.shape[0]
      ncat = meang.shape[1]
      dfbn = ncat - 1
      dfwn = nobs - ncat
      msb = ssbn / float(dfbn)
      msw = sswn / float(dfwn)
      f = msb / msw
      prob = stats.f.sf(f, dfbn, dfwn)
      R2 = ssbn / (sswn + ssbn)  # R-squared
      resstd = np.sqrt(msw)  # residual standard deviation
      # print(f, prob
  
      def _fix2scalar(z):  # return number
          if np.shape(z) == (1, 1):
              return z[0, 0]
          else:
              return z
  
      f, prob, R2, resstd = lmap(_fix2scalar, (f, prob, R2, resstd))
      return f, prob, R2, resstd
  
file_path: statsmodels/statsmodels/sandbox/regression/anova_nistcertified.py
imports: from statsmodels.compat.python import lmap
  import os
  import numpy
  from scipy import stats
  from statsmodels.tools.tools import add_constant
  from statsmodels.regression.linear_model import OLS
  from .try_ols_anova import data2dummy
label_desc: Use image node_id 2 for calling a global function with example usage: anova_oneway(y, x, seq) and returns: f,  prob,  R2,  resstd, z, z