Description Usage Arguments Value Note Author(s) See Also Examples
Computes relative risks (RR) of death over specified years-since-diagnosis intervals. US mortality rates obtained via the R package demography are used to compute background death dedepence on age and calendar year. RR is then O/E where O and E are the number of observed and expected cases.
1 |
canc |
Input data.frame with columns: yrdx, agedx, sex, surv (in years), and status (1=dead). |
mrt |
List with male and female fields, each matrices with mortality rates vs year and age. |
brkst |
Vector of breaks in years used to form Times since diagnosis intervals/bins. |
brksy |
Vector of breaks of calendar Years to show mortality trends. Leave NULL for all in one. |
data.frame with observed and expected cases, RR, and RR CI for each tsd interval.
This function was developed with support from the Cleveland Clinic Foundation.
Tom Radivoyevitch (radivot@ccf.org)
SEERaBomb-package, mk2D,seerSet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
library(SEERaBomb)
load("~/data/SEER/mrgd/cancDef.RData") #loads in canc
lu=canc%>%filter(cancer=="lung")
lu=lu%>%mutate(status=as.numeric(COD>0))%>%select(yrdx,agedx,sex,surv,status)
lu=lu%>%mutate(surv=round((surv+0.5)/12,3))#convert surv to years
# library(demography)
# d=hmd.mx("USA", "username", "password") #make an account and put your info in here
# mrt=d$rate
# save(mrt,file="~/data/usMort/mrt.RData")
load("~/data/usMort/mrt.RData"); object.size(mrt)# 250kb
brks=c(0,0.5,3,6,10,15,20,25)
(dlu=msd(lu,mrt,brkst=brks))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.