class_docstr: Significance test for the categorical variables in a nonparametric
  regression.
  
  Parameters
  ----------
  model : Instance of KernelReg class
      This is the nonparametric regression model whose elements
      are tested for significance.
  test_vars : tuple, list of one element
      index of position of the discrete variable to be tested
      for significance. E.g. (3) tests variable at
      position 3 for significance.
  nboot : int
      Number of bootstrap samples used to determine the distribution
      of the test statistic in a finite sample. Default is 400
  
  Attributes
  ----------
  sig : str
      The significance level of the variable(s) tested
      "Not Significant": Not significant at the 90% confidence level
                          Fails to reject the null
      "*": Significant at the 90% confidence level
      "**": Significant at the 95% confidence level
      "***": Significant at the 99% confidence level
  
  Notes
  -----
  This class currently does not allow joint hypothesis.
  Only one variable can be tested at a time
  
  References
  ----------
  See [9] and chapter 12 in [1].
docstr: Computes the test statistic
code: def _compute_test_stat(self, Y, X):
      """Computes the test statistic"""
  
      dom_x = np.sort(np.unique(self.exog[:, self.test_vars]))
  
      n = np.shape(X)[0]
      model = KernelReg(
          Y,
          X,
          self.var_type,
          self.model.reg_type,
          self.bw,
          defaults=EstimatorSettings(efficient=False),
      )
      X1 = copy.deepcopy(X)
      X1[:, self.test_vars] = 0
  
      m0 = model.fit(data_predict=X1)[0]
      m0 = np.reshape(m0, (n, 1))
      zvec = np.zeros((n, 1))  # noqa:E741
      for i in dom_x[1:]:
          X1[:, self.test_vars] = i
          m1 = model.fit(data_predict=X1)[0]
          m1 = np.reshape(m1, (n, 1))
          zvec += (m1 - m0) ** 2  # noqa:E741
  
      avg = zvec.sum(axis=0) / float(n)
      return avg
  
imports: import copy
  import numpy
  from scipy import optimize
  from scipy.stats.mstats import mquantiles
  from ._kernel_base import GenericKDE, EstimatorSettings, gpke, LeaveOneOut, _get_type_pos, _adjust_shape, _compute_min_std_IQR, kernel_func
label_desc: Use image node_id 1 for calling the TestRegCoefD obj's underlying member method code with example usage: obj._compute_test_stat(Y, X) and returns: avg