title: Does anyone know what the difference between n and strata in a survobject?
body: <p>Whenever I use survfit in R I get different values for n and strata:
  For example 
  I get n: 150, 167 (add up to 317 which is the total input)
  strata: 149, 163</p>
  
  <p>From the help page <code>?survival::survfit.object</code>:</p>
  
  <blockquote>
    <p>n = total number of subjects in each curve.</p>
    
    <p>strata = if there are multiple curves, this component gives the number
    of elements of the time etc. vectors corresponding to the first curve,
    the second curve, and so on. The names of the elements are labels for
    the curves.</p>
  </blockquote>
  
  <p>I don't understand why the numbers are different.</p>
  
  <p>EDIT:
  I did think about the issue being the repeated time data points, as you can see in the example database there are 9 instances of duplicate values (18 in total). This would mean only 317 - 9 = 308 values are used.
  But strata adds up to: 149+163=312, not 308.
  The code used is:</p>
  
  <pre><code>library(survival)
  library(survminer)
  survival &lt;- surv_fit(Surv(time = Time,event = Event)~Group,data=x, conf.int=0.95)
  </code></pre>
  
  <p>Update:
  It is to do with repeated times, within each group.
  If I separate the data in group A and group B there is 1 duplicate event in group A and 4 duplicate events in froup B. Therefore there would be 317 - 1 - 4 = 312 time points in the plot.</p>
  
  <p>And in each group it would be: 
  A: 150 - 1 = 149
  B: 167 - 4 = 163</p>
  
  <p>As strata shows.</p>