title: In Surv(start_time, end_time, new_death) : Stop time must be > start time, NA created
body: <p>I am using the package "survival" to fit a cox model with time intervals (intervals are 30 days long). I am reading the data in from an xlsx worksheet.  I keep getting the error that says my stop time must be greater than my start time. The start values are all smaller than the stop values. </p>
  
  <p>I checked to make sure these are being read in as numbers which they are. I also changed them to integers which did not solve the problem. I used this code to see if any observations met this criterion:</p>
  
  <pre><code>a &lt;- a1[which(a1$end_time &gt; a1$start_time),]
  </code></pre>
  
  <p>About half the dataset meets this criterion, but when I look at the data all the start times appear to be less than the end times.</p>
  
  <p>Does anyone know why this is happening and how I can fix it? I am an R newbie so perhaps there is something obvious I don't know about?</p>
  
  <pre><code>model1&lt;- survfit(Surv(start_time, end_time, censor) ~ exp, data=a1, weights = weight)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xiMr5.gif" alt="enter image description here"></p>
  
  <p><a href="https://i.stack.imgur.com/8Idck.gif" rel="nofollow noreferrer">enter image description here</a></p>