code: def do1(fname, ties, entry_f, strata_f):
      # Read the test data.
      time, status, entry, exog = TestPHReg.load_file(fname)
      n = len(time)
  
      vs = fname.split("_")
      n = int(vs[2])
      p = int(vs[3].split(".")[0])
      ties1 = ties[0:3]
  
      # Needs to match the kronecker statement in survival.R
      strata = np.kron(range(5), np.ones(n // 5))
  
      # No stratification or entry times
      mod = PHReg(time, exog, status, ties=ties)
      phrb = mod.fit(**args)
      coef_r, se_r, time_r, hazard_r = get_results(n, p, None, ties1)
      assert_allclose(phrb.params, coef_r, rtol=1e-3)
      assert_allclose(phrb.bse, se_r, rtol=1e-4)
      time_h, cumhaz, surv = phrb.baseline_cumulative_hazard[0]
  
      # Entry times but no stratification
      phrb = PHReg(time, exog, status, entry=entry, ties=ties).fit(
          **args
      )
      coef, se, time_r, hazard_r = get_results(n, p, "et", ties1)
      assert_allclose(phrb.params, coef, rtol=1e-3)
      assert_allclose(phrb.bse, se, rtol=1e-3)
  
      # Stratification but no entry times
      phrb = PHReg(time, exog, status, strata=strata, ties=ties).fit(
          **args
      )
      coef, se, time_r, hazard_r = get_results(n, p, "st", ties1)
      assert_allclose(phrb.params, coef, rtol=1e-4)
      assert_allclose(phrb.bse, se, rtol=1e-4)
  
      # Stratification and entry times
      phrb = PHReg(
          time, exog, status, entry=entry, strata=strata, ties=ties
      ).fit(**args)
      coef, se, time_r, hazard_r = get_results(n, p, "et_st", ties1)
      assert_allclose(phrb.params, coef, rtol=1e-3)
      assert_allclose(phrb.bse, se, rtol=1e-4)
  
      # smoke test
      time_h, cumhaz, surv = phrb.baseline_cumulative_hazard[0]
  
imports: import itertools
  import os
  import numpy
  from statsmodels.duration.hazard_regression import PHReg
  from numpy.testing import assert_allclose, assert_equal, assert_
  import pandas
  import pytest
  from .results import survival_r_results
  from .results import survival_enet_r_results
label_desc: Use image node_id 2 for calling the TestPHReg obj's underlying member method code with example usage: obj.do1(fname, ties, entry_f, strata_f) without return types