FreqID_HReg2: Fit Parametric Frailty Illness-Death Model for Semi-Competing...

View source: R/FreqID_HReg2.R

FreqID_HReg2R Documentation

Fit Parametric Frailty Illness-Death Model for Semi-Competing Risks Data

Description

Fit Parametric Frailty Illness-Death Model for Semi-Competing Risks Data

Usage

FreqID_HReg2(
  Formula,
  data,
  na.action = "na.fail",
  subset = NULL,
  hazard = c("weibull"),
  frailty = TRUE,
  model,
  knots_list = NULL,
  p0_vec = rep(4, 3),
  startVals = NULL,
  hessian = TRUE,
  control = NULL,
  optim_method = if (tolower(hazard) %in% c("royston-parmar", "rp")) "BFGS" else
    "L-BFGS-B"
)

Arguments

Formula

a Formula object, with the outcome on the left of a ~, and covariates on the right. It is of the form, time to non-terminal event + corresponding censoring indicator | time to terminal event + corresponding censoring indicator ~ covariates for h_1 | covariates for h_2 | covariates for h_3. For example, y_1 + delta_1 | y_2 + delta_2 ~ x_1 | x_2 | x_3.

data

a data.frame in which to interpret the variables named in Formula.

na.action

how NAs are treated. See model.frame.

subset

a specification of the rows to be used: defaults to all rows. See model.frame.

hazard

String specifying the form of the baseline hazard.

frailty

Boolean indicating whether a gamma distributed subject-specific frailty should be included. Currently this must be set to TRUE.

model

String specifying the transition assumption

knots_list

Used for hazard specifications besides Weibull, a list of three increasing sequences of integers, each corresponding to the knots for the flexible model on the corresponding transition baseline hazard. If NULL, will be created by get_default_knots_list.

p0_vec

vector of length three of integers indicating how many baseline hazard parameters should be specified for each of the three transition hazards. This input is only relevant when hazard is something other than "weibull" and is superceded by knots_list.

startVals

A numeric vector of parameter starting values, arranged as follows: the first k_1+k_2+k_3 elements correspond to the baseline hazard parameters, then the k_1+k_2+k_3+1 element corresponds to the gamma frailty log-variance parameter, then the lastq_1+q_2+q_3 elements correspond with the regression parameters. If set to NULL, will be generated automatically using get_start.

hessian

Boolean indicating whether the hessian (aka, the inverse of the covariance matrix) should be computed and returned.

control

a list of control attributes passed directly into the optim function.

optim_method

a string naming which optim method should be used.

Value

FreqID_HReg2 returns an object of class Freq_HReg.


harrisonreeder/SemiCompRisksPen documentation built on Dec. 13, 2024, 5:30 a.m.