Learn R Programming

SEERaBomb (version 2019.2)

simSurv: Simulate Survival Times

Description

Uses background mortality rates to simulate background survival time for matching sex, age and year.

Usage

simSurv(d,mrt,rep=1,ltb=NULL,unif=TRUE)

Arguments

d

Data frame containing sex, agedx, yrdx, surv, and status columns of observed data.

mrt

Mortality data binary made by mkMrt().

rep

Number of simulated replicates of each observed case.

ltb

Life table data binary made by mkLT(). Default of NULL => skip it.

unif

TRUE => death time in final year is uniform random draw. False => death at mid-point of year.

Value

Input d with simulation rows added below it, identified as "simulated" in a new column called type.

See Also

SEERaBomb-package,mkSEER

Examples

Run this code
# NOT RUN {
library(SEERaBomb)
mkLT()
load("~/data/usMort/ltb.RData")
tail(ltb$Female)
# }

Run the code above in your browser using DataLab