calc_risk_term: Calculate absolute risk profiles after non-terminal event

View source: R/calc_risks.R

calc_risk_termR Documentation

Calculate absolute risk profiles after non-terminal event

Description

This function calculates absolute risk profiles conditional on non-terminal event already occurring.

Usage

calc_risk_term(
  para,
  Xmat3,
  hazard,
  knots_list = NULL,
  t_cutoff,
  t_start,
  tol = 0.001,
  frailty = TRUE,
  type = "marginal",
  gamma = 1,
  model = "semi-markov",
  h3_tv = "none",
  tv_knots = NULL
)

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.

Xmat3

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

hazard

String specifying the form of the baseline hazard.

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.

t_cutoff

Numeric vector indicating the time(s) to compute the risk profile.

t_start

Numeric scalar indicating the dynamic start time to compute the risk profile. Set to 0 by default.

tol

Numeric value for the tolerance of the numerical integration procedure.

frailty

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

type

String either indicating 'marginal' for population-averaged probabilities, or 'conditional' for probabilities computed at the specified gamma

gamma

Numeric value indicating the fixed level of the frailty assumed for predicted probabilities, if 'type' is set to 'conditional'

model

String specifying the transition assumption

h3_tv

String indicating whether there is an effect of t1 on hazard 3.

tv_knots

for piecewise effect of t1 in h3, these are the knots at which the effect jumps

Value

if Xmat has only one row, and t_cutoff is a scalar, then returns a 4 element row matrix of probabilities. If Xmat has n rows, then returns an n by 4 matrix of probabilities. If Xmat has n rows and t_cutoff is a vector of length s, then returns an s by 4 by n array.


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