code: def test_score_test_alpha(self):
      # this is mostly sanity check
      # we need heteroscedastic model, i.e. exog_dispersion as comparison
      # res1 = self.res1
      modr = self.klass(endog, exog.values[:, :-1])
      resr = modr.fit(method="newton", maxiter=300)
      params_restr = np.concatenate([resr.params[:], [0]])
      r_matrix = np.zeros((1, len(params_restr)))
      r_matrix[0, -1] = 1
      # use random expg_extra, then we don't reject null
      # exog_extra = res1.model.exog[:, 1:2]
      np.random.seed(987125643)
      exog_extra = 0.01 * np.random.randn(endog.shape[0])
  
      from statsmodels.base._parameter_inference import (
          score_test,
          _scorehess_extra,
      )
  
      # note: we need params for the restricted model here
      # if params is not given, then it will be taked from results instance
      sh = _scorehess_extra(
          resr, exog_extra=None, exog2_extra=exog_extra, hess_kwds=None
      )
      assert not np.isnan(sh[0]).any()
  
      # sc1 = score_test(res1, params_constrained=params_restr,
      #                  k_constraints=1)
      sc2 = score_test(resr, exog_extra=(None, exog_extra))
      assert sc2[1] > 0.01
  
      # sc1_hc = score_test(res1, params_constrained=params_restr,
      #                   k_constraints=1, r_matrix=r_matrix, cov_type="HC0")
      sc2_hc = score_test(
          resr, exog_extra=(None, exog_extra), cov_type="HC0"
      )
      assert sc2_hc[1] > 0.01
  
imports: import warnings
  import numpy
  from numpy.testing import assert_allclose, assert_equal
  import pytest
  from statsmodels.tools.tools import add_constant
  from statsmodels.base._prediction_inference import PredictionResultsMonotonic
  from statsmodels.discrete.discrete_model import BinaryModel, Logit, Probit, Poisson, NegativeBinomial, NegativeBinomialP, GeneralizedPoisson
  from statsmodels.discrete.count_model import ZeroInflatedPoisson, ZeroInflatedNegativeBinomialP, ZeroInflatedGeneralizedPoisson
  from statsmodels.sandbox.regression.tests.test_gmm_poisson import DATA
  from .results import results_predict
label_desc: Use image node_id 3 for calling the CheckExtras obj's underlying member method code with example usage: obj.test_score_test_alpha() without return types