fitCoxPH: Fit coxph model with a predictor variable and a set of...

View source: R/pipeline_modules.R

fitCoxPHR Documentation

Fit coxph model with a predictor variable and a set of covariates.

Description

Fit coxph model with a predictor variable and a set of covariates.

Usage

fitCoxPH(
  modelPredictions,
  targetTable,
  covariatesTable,
  covariateColnames,
  pipelineRunInformation,
  modelLabel
)

Arguments

modelPredictions

A vector of model predictions.

targetTable

A matrix/data.frame with columns named 'Event' and 'time_to_event'. 'Event' should correspond to a binary label. 'time_to_event' should correspond to a positive numerical value representing the survival time (when Event == 1) or the time-to-censoring (when Event == 0)

covariatesTable

A table that includes columns corresponding to covariates to be included in the model.

covariateColnames

A named list with names corresponding to the covariate column names to be used in the model. The values in the list should correspond to the actual column name in covariatesTable

pipelineRunInformation

The object originally created by beginPipelineRun.

modelLabel

A string that will act as a label for this function call. The label will be used as a prefix for the saved object filenames in this function call.

Value

A named list consisting of the following elements: 'coxPHModel' is the fit coxph model object (from the survival library). 'coxPHModelSummary' is the result from calling summary() on coxPHModel. 'pseudoR2' is the pseudo r-squared value for the model. 'hazardRatio' is the hazard ratio for the predictor variable.


marioni-group/MethylPipeR documentation built on Oct. 10, 2024, 3:32 p.m.