fit_survival_model {Landmarking}R Documentation

Fit a survival sub-model

Description

This function is a helper function for fit_LOCF_landmark_model and fit_LME_landmark_model.

Usage

fit_survival_model(
  data,
  individual_id,
  cv_name = NA,
  covariates,
  event_time,
  event_status,
  survival_submodel = c("standard_cox", "cause_specific", "fine_gray"),
  x_hor
)

Arguments

data

Data frame containing covariates and time-to-event data, one row for each individual.

individual_id

Character string specifying the column name in data which contains the individual identifiers

cv_name

Character string specifying the column name in data that indicates cross-validation fold. If no cross-validation is needed, set this parameter to NA.

covariates

Vector of character strings specifying the column names in data_long which correspond to the covariates

event_time

Character string specifying the column name in data which contains the event time

event_status

Character string specifying the column name in data which contains the event status (where 0=censoring, 1=event of interest, if there are competing events these are labelled 2 or above). Events at time x_hor should be labelled censored.

survival_submodel

Character string specifying which survival submodel to use. Three options: the standard Cox model i.e. no competing risks ("standard_cox"), the cause-specific regression model ("cause_specific"), or the Fine Gray regression model ("fine_gray")

x_hor

Numeric specifying the horizon time(s)

Details

For the survival submodel, there are three choices of model:

The latter two models estimate the probability of the event of interest in the presence of competing events.

For both the c-index and Brier score calculations, inverse probability censoring weighting (IPCW) is used to create weights which account for the occurrence of censoring. The censoring model assumes for this function is the Kaplan Meier model, i.e. censoring occurs independently of covariates.

Value

List containing data_survival and model_survival

data_survival contains the predicted risk of event by the horizon time x_hor.

model_survival contains the outputs from the function used to fit the survival submodel, including the estimated parameters of the model. For a model using cross-validation, model_survival contains a list of outputs with each element in the list corresponding to a different cross-validation fold.

Author(s)

Isobel Barrott isobel.barrott@gmail.com


[Package Landmarking version 1.0.0 Index]