title: coxme and behavioural data
body: <p>I have behavioural data (latencies, i.e., time until an individual did a certain behaviour) that I am trying to model with a coxme (mixed cox regression) with the latency as a response, test as an explanatory variable, and ID as a random effect.  I choose the coxme because there are many latencies capped at 20 minutes (i.e., individual did not do the behaviour within 20 minute observation).</p>
  <p>I've only been able to find examples for a coxme regression with a survival curve as the response, so I'm not sure how to adapt this model to my data.</p>
  <p>At present, I've tried the following, and received an error:</p>
  <pre><code>coxme(latency ~ tests + (1|ID), data = df)
  Error in if (n == 0) stop(&quot;No observations remain in the data set&quot;) : 
    argument is of length zero
  </code></pre>
  <p>How do I get this to work?</p>
  <p>EDIT: updated with an example dataset.  Note, all latency values are &gt; 0 and capped at 20.</p>
  <pre><code>df &lt;- data.frame(ID = rep(c(LETTERS[1:20]),each=4),
                   tests = rep(letters[1:4], replace = FALSE),
                   time = abs(rnorm(80, mean = 10, sd = 4)),
                   latency = ifelse(time &gt; 20, 20, time)) 
  </code></pre>