Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

R; Making the rate table for relative survival analysis

$
0
0

The package "relsurv" can calculate relative survival. Input are your data (in my case patients diagnosed with colorectal cancer) and then the rate table which includes the change of surviving to the next age category, generally split by sex and year of diagnosis.

In my case, I want to have relative survival according to age, sex, year of diagnosis and socio-economic score. I have all the data that should go into the rate table in 1 data frame:

> head(lifetable)
     sex  seifa age      2007      2008      2009      2010      2011      2012      2013
1 female SEIFA1   0 0.9947100 0.9953400 0.9956200 0.9959200 0.9964100 0.9966000 0.9966800
2 female SEIFA1   1 0.9996625 0.9996613 0.9997038 0.9996489 0.9996425 0.9996667 0.9997556
3 female SEIFA1   2 0.9997750 0.9997968 0.9998105 0.9998119 0.9998350 0.9998167 0.9998656
4 female SEIFA1   3 0.9998375 0.9998374 0.9998460 0.9998621 0.9998625 0.9998667 0.9999022
5 female SEIFA1   4 0.9998750 0.9998645 0.9998697 0.9998871 0.9998900 0.9999000 0.9999267
6 female SEIFA1   5 0.9998827 0.9999077 0.9998887 0.9998956 0.9999037 0.9999160 0.9999280

I am looking for a quick and easy way to transform this into the 'ratetable'. I searched a lot but found nothing... Anyone?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>