code: def test_GLSARlag():
      # test that results for lag>1 is close to lag=1, and smaller ssr
  
      from statsmodels.datasets import macrodata
  
      d2 = macrodata.load_pandas().data
      g_gdp = 400 * np.diff(np.log(d2["realgdp"].values))
      g_inv = 400 * np.diff(np.log(d2["realinv"].values))
      exogg = add_constant(
          np.c_[g_gdp, d2["realint"][:-1].values], prepend=False
      )
  
      mod1 = GLSAR(g_inv, exogg, 1)
      res1 = mod1.iterative_fit(5)
  
      mod4 = GLSAR(g_inv, exogg, 4)
      res4 = mod4.iterative_fit(10)
  
      assert_array_less(np.abs(res1.params / res4.params - 1), 0.03)
      assert_array_less(res4.ssr, res1.ssr)
      assert_array_less(np.abs(res4.bse / res1.bse) - 1, 0.015)
      assert_array_less(
          np.abs((res4.fittedvalues / res1.fittedvalues - 1).mean()),
          0.015,
      )
      assert_equal(len(mod4.rho), 4)
  
file_path: statsmodels/statsmodels/regression/tests/test_glsar_gretl.py
imports: import os
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal, assert_allclose, assert_array_less
  from statsmodels.regression.linear_model import OLS, GLSAR
  from statsmodels.tools.tools import add_constant
  from statsmodels.datasets import macrodata
  import statsmodels.stats.sandwich_covariance
  import statsmodels.stats.diagnostic
  import statsmodels.stats.outliers_influence
label_desc: Use image node_id 2 for calling a global function with example usage: test_GLSARlag() without return types