hazard_elife: Profile likelihood for hazard

View source: R/hazard.R

hazard_elifeR Documentation

Profile likelihood for hazard

Description

This function computes the hazard for different elife parametric models with profile-likelihood based confidence intervals. It is also used to provide local hazard plots at varying thresholds.

Usage

hazard_elife(
  x,
  time,
  time2 = NULL,
  event = NULL,
  status = NULL,
  thresh = 0,
  ltrunc = NULL,
  rtrunc = NULL,
  type = c("right", "left", "interval", "interval2"),
  family = c("exp", "gp", "gomp", "weibull", "extgp"),
  weights = rep(1, length(time)),
  level = 0.95,
  psi = NULL,
  plot = FALSE,
  arguments = NULL,
  ...
)

Arguments

x

value of the threshold exceedance at which to estimate the hazard

time

excess time of the event of follow-up time, depending on the value of event

time2

ending excess time of the interval for interval censored data only.

event

status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE for death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have experienced an event.

status

integer vector giving status of an observation. If NULL (default), this argument is computed internally based on type.

thresh

vector of thresholds

ltrunc

lower truncation limit, default to NULL

rtrunc

upper truncation limit, default to NULL

type

character string specifying the type of censoring. Possible values are "right", "left", "interval", "interval2".

family

string; choice of parametric family

weights

weights for observations

level

numeric; the level for the confidence intervals. Default to 0.95

psi

optional vector of hazard at which to compute the profile log likelihood

plot

logical; if true, display the profile log-likelihood. Default to FALSE.

arguments

a named list specifying default arguments of the function that are common to all elife calls

...

additional arguments for optimization, currently ignored.

Value

an invisible object of class elife_hazard containing information about the profile likelihood

Examples

n <- 2500
time <- samp_elife(n = n, scale = 2,
family = "gp", shape = 0.1,
lower = ltrunc <- runif(n),
upper = rtrunc <- (5 + runif(n)), type2 = "ltrt")
hazard_elife(x = 2, time = time,
 ltrunc = ltrunc, rtrunc = rtrunc, family = "exp")

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