Learn R Programming

SEERaBomb (version 2015.2)

getPY: Get tsd interval PY

Description

Gets person year (PY) contributions to a particular time since diagnosis (tsd) interval from survival times.

Usage

getPY(surv, bin, binS, brks)

Arguments

surv
The total survival time of the patient.
bin
The label of the specific bin of interest.
binS
The character vector of bin labels in which binLab exists.
brks
The numeric vector of break points used by cut to create binS.

Value

  • A vector as long as the survival vector input of PY at risk in a particular interval.

See Also

SEERaBomb-package, getBinInfo

Examples

Run this code
library(SEERaBomb)
brks=c(0,0.25,1,3,6)  
(binS=levels(cut(brks+0.1,breaks=c(brks,100)))) #make a vector of intervals 
survTimes=c(8,16,1.5,3.7)
getPY(survTimes,binS[1],binS,brks)# all contribute 0.25 to first interval 
getPY(survTimes,binS[4],binS,brks)# 3rd and 4th survivals contribute 0 and 0.7 to (3,6]
getPY(survTimes,binS[5],binS,brks)# 1st and 2nd survival contribute 2 and 10 years to (6,100]

Run the code above in your browser using DataLab