samp2_elife: Sample lifetime from excess lifetime model

View source: R/simulation.R

samp2_elifeR Documentation

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
)

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

Value

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


longevity documentation built on Nov. 12, 2023, 5:07 p.m.