msd: Mortality vs years Since Diagnosis

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/msd.R

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

1
msd(canc,mrt,brkst=c(0,2,5),brksy=NULL) 

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.

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.

Value

data.frame with observed and expected cases, RR, and RR CI for each tsd interval.

Note

This function was developed with support from the Cleveland Clinic Foundation.

Author(s)

Tom Radivoyevitch (radivot@ccf.org)

See Also

SEERaBomb-package, mk2D,seerSet

Examples

 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)

SEERaBomb documentation built on Dec. 16, 2019, 1:21 a.m.