Learn R Programming

longevity (version 1.2.1)

samp2_elife: Sample lifetime from excess lifetime model

Description

Given parameters of a elife distribution, sampling window and birth dates with excess lifetimes, sample new observations; excess lifetime at c1 are sampled from an exponential distribution, whereas the birth dates are sampled from a jittered histogram-based distribution The new excess lifetime above the threshold are right-censored if they exceed c2.

Usage

samp2_elife(
  n,
  scale,
  shape,
  family = c("exp", "gp", "gomp", "gompmake", "weibull", "extgp", "gppiece",
    "extweibull", "perks", "beard", "perksmake", "beardmake"),
  xcal,
  c1,
  c2
)

Value

list with new birthdates (xcal), excess lifetime at c1 (ltrunc), excess lifetime above u (dat) and right-censoring indicator (rightcens).

Arguments

n

sample size

scale

scale parameter(s)

shape

shape parameter(s)

family

string; choice of parametric family

xcal

date at which individual reaches u years

c1

date, first day of the sampling frame

c2

date, last day of the sampling frame