getPY: Get tsd interval PY

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getPY.R

Description

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

Usage

1
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.

Author(s)

Tom Radivoyevitch (radivot@ccf.org)

See Also

SEERaBomb-package, getBinInfo

Examples

1
2
3
4
5
6
7
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]

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