code: def test_formula(self):
      np.random.seed(34234)
      time = 50 * np.random.uniform(size=200)
      status = np.random.randint(0, 2, 200).astype(np.float64)
      exog = np.random.normal(size=(200, 4))
      entry = np.zeros_like(time)
      entry[0:10] = time[0:10] / 2
  
      df = pd.DataFrame(
          {
              "time": time,
              "status": status,
              "exog1": exog[:, 0],
              "exog2": exog[:, 1],
              "exog3": exog[:, 2],
              "exog4": exog[:, 3],
              "entry": entry,
          }
      )
  
      mod1 = PHReg(time, exog, status, entry=entry)
      rslt1 = mod1.fit()
  
      # works with "0 +" on RHS but issues warning
      fml = "time ~ exog1 + exog2 + exog3 + exog4"
      mod2 = PHReg.from_formula(fml, df, status=status, entry=entry)
      rslt2 = mod2.fit()
  
      mod3 = PHReg.from_formula(fml, df, status="status", entry="entry")
      rslt3 = mod3.fit()
  
      assert_allclose(rslt1.params, rslt2.params)
      assert_allclose(rslt1.params, rslt3.params)
      assert_allclose(rslt1.bse, rslt2.bse)
      assert_allclose(rslt1.bse, rslt3.bse)
  
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 4 for calling the TestPHReg obj's underlying member method code with example usage: obj.test_formula() without return types