nlogLikPW_ID_frail_M: Negative Log-Likelihood Function for Illness-Death Model

View source: R/piecewise_functions.R

nlogLikPW_ID_frail_MR Documentation

Negative Log-Likelihood Function for Illness-Death Model

Description

Function returning the negative log-likelihood for the illness-death model, under piecewise constant baseline hazard, gamma subject-specific frailty, and Markov transition assumption. Typically, this function will not be used directly by the user, but as part of a larger estimation procedure.

Usage

nlogLikPW_ID_frail_M(
  para,
  y1,
  y2,
  delta1,
  delta2,
  Xmat1 = NULL,
  Xmat2 = NULL,
  Xmat3 = NULL,
  basis1,
  basis2,
  basis3,
  basis3_y1
)

Arguments

para

A numeric vector of parameters, 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.

y1, y2

Numeric vectors of length n with (possibly censored) non-terminal and terminal event times

delta1, delta2

Numeric vectors of length n with indicators of 1 if the event was observed and 0 otherwise

Xmat1, Xmat2, Xmat3

Numeric matrices with n rows and q_1,q_2,q_3 columns containing covariates.

basis1, basis2, basis3, basis3_y1

Numeric matrices with n rows and k_1,k_2,k_3 columns with piecewise/spline basis function values at the corresponding y1 and y2 values. Under semi-Markov model, basis3 represents basis derived from y_2-y_1 and basis3_y1 is unused, while under Markov model, basis3 represents basis derived from y_2 and basis3_y1 is from y_1 Not used under Weibull model.

Value

Returns numeric sum of negative log likelihood contributions.


hreed7/SemiCompRisksPen documentation built on Dec. 15, 2024, 5:41 p.m.