title: life expectancy survival package R
body: <p>I would like to calculate the life-years lost due to a disease in a way that I correct for other variables in the model (corrected group prognosis method). My dataset is a cohort of individuals for which I have follow-up time till death/censored and a variable whether they died, together with covariates as age, sex and prevalence of disease. I searched the web and I got the impression this should be possible with the survival package in R. </p>
  
  <p>I used the following code which returns probabilities: </p>
  
  <pre><code>fit1 &lt;- coxph(Surv(fup_death, death) ~  age + sex + prev_disease, data) 
  
  direct &lt;- survexp( ~prev_disease, data=data, ratetable=fit1)
  </code></pre>
  
  <p>I also tried the survfit function, but than my computer crashes: </p>
  
  <pre><code>t&lt;-survfit(fit1, newdata = data)
  </code></pre>
  
  <p>How can I derive the life-expectancy in the ones with the disease and without the disease? Or should I do it differently?</p>
  
  <p>Thanks you in advance! </p>
  
  <p>Best, 
  Symen</p>