title: Fitting a gamma frailty model in R (coxph)
body: <p>I have a <a href="http://yaap.it/paste/c11b9fdcfd68d02b#gIVtLrrme3MaiQd9hHy1zcTjRq7VsVQ8eAZ2fol1lUc=" rel="noreferrer">data set</a> with 6 clusters, each containing 48 (possibly censored, in which case <code>event = 0</code>) survival times. The <code>x</code> column contains a cluster-specific explanatory variable. I try to describe that data with a gamma frailty model as follows</p>
  
  <pre><code> library(survival)
  
   mod &lt;- coxph(Surv(time, event) ~ 
     x + frailty.gamma(cluster, eps=1e-10, method="em", sparse=0),
                outer.max=1000, iter.max=10000,
                data=data)
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <pre><code>Error in if (history[2, 3] &lt; (history[1, 3] + 1)) theta &lt;- mean(history[1:2,  : 
    missing value where TRUE/FALSE needed
  </code></pre>
  
  <p>Does anyone have an idea on how to debug?</p>