Learn R Programming

SEERaBomb (version 2016.1)

msd: Mortality vs years Since Diagnosis

Description

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.

Usage

msd(canc,mrt,brks)

Arguments

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.
brks
Vector of breaks in years used to form years-since-diagnosis intervals/bins.

Value

See Also

SEERaBomb-package, mk2D,seerSet

Examples

Run this code
## 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,brks))
# ## End(Not run)

Run the code above in your browser using DataLab