code: def somers_d(event_times, x, event_observed=None) -> float:
      """
      A measure of rank association between [-1, 1] between a censored variable, event_times,
      and another (uncensored) variable, x. -1 is strong anti-correlation, 1 is strong correlation.
  
  
      event_times: iterable
           a length-n iterable of observed survival times.
      x: iterable
          a length-n iterable to compare against
      event_observed: iterable, optional
          a length-n iterable censoring flags, 1 if observed, 0 if not. Default None assumes all observed.
  
  
      Examples
      --------
      .. code:: python
          from lifelines.datasets import load_rossi
          from lifelines.utils
  
          T, E = df['week'], df['arrest']
          x = df['age']
          somers_d(T, x, E)
  
  
      """
      return 2 * concordance_index(event_times, x, event_observed) - 1
  
file_path: lifelines/lifelines/utils/concordance.py
imports: import numpy
  from lifelines.utils.btree import _BTree
label_desc: Use image node_id 1 for calling a global function with example usage: somers_d(event_times, x, event_observed) and returns: unknown