code: def test_incidence2():
      # Check that the cumulative incidence functions for all competing
      # risks sum to the complementary survival function.
  
      np.random.seed(2423)
      n = 200
      time = -np.log(np.random.uniform(size=n))
      status = np.random.randint(0, 3, size=n)
      ii = np.argsort(time)
      time = time[ii]
      status = status[ii]
      ci = CumIncidenceRight(time, status)
      statusa = 1 * (status >= 1)
      sf = SurvfuncRight(time, statusa)
      x = 1 - sf.surv_prob
      y = (ci.cinc[0] + ci.cinc[1])[np.flatnonzero(statusa)]
      assert_allclose(x, y)
  
imports: import os
  import numpy
  from statsmodels.duration.survfunc import SurvfuncRight, survdiff, plot_survfunc, CumIncidenceRight
  from numpy.testing import assert_allclose
  import pandas
  import pytest
label_desc: Use image node_id 18 for calling a global function with example usage: test_incidence2() without return types