Skip to contents

Principal Component Cox models address the challenges of high-dimensional survival data by using principal component analysis (PCA) to reduce dimensionality before fitting Cox regression models. This approach is particularly useful when the number of covariates is large relative to sample size, helping to avoid overfitting while retaining important patterns in the data. The method supports various PCA approaches including standard PCA, sparse PCA, and supervised PCA for survival data.

Usage

principalcox(
  data,
  elapsedtime,
  outcome,
  highdim_vars,
  clinical_vars,
  outcomeLevel = "1",
  pca_method = "standard",
  n_components = 5,
  variance_threshold = 0.95,
  component_selection = "fixed_number",
  scaling_method = "standardize",
  sparse_parameter = 0.1,
  cross_validation = 5,
  confidence_level = 0.95,
  show_pca_summary = TRUE,
  show_component_loadings = TRUE,
  show_cox_results = TRUE,
  show_variable_importance = FALSE,
  show_model_comparison = FALSE,
  scree_plot = TRUE,
  biplot = FALSE,
  loading_plot = TRUE,
  survival_plot = TRUE,
  showSummaries = TRUE,
  showExplanations = TRUE
)

Arguments

data

the data as a data frame

elapsedtime

Time to event or censoring

outcome

Event indicator (1 = event, 0 = censored)

highdim_vars

High-dimensional variables for principal component analysis

clinical_vars

Clinical variables to include alongside principal components

outcomeLevel

Level indicating event occurrence

pca_method

Method for principal component analysis

n_components

Number of principal components to retain

variance_threshold

Cumulative variance threshold for automatic component selection

component_selection

Method for selecting the number of components

scaling_method

Method for scaling variables before PCA

sparse_parameter

Sparsity parameter for sparse PCA (proportion of non-zero loadings)

cross_validation

Number of folds for cross-validation component selection

confidence_level

Confidence level for confidence intervals

show_pca_summary

Display PCA summary statistics

show_component_loadings

Display principal component loadings

show_cox_results

Display Cox regression results for principal components

show_variable_importance

Display importance of original variables in components

show_model_comparison

Compare different PCA approaches and component numbers

scree_plot

Display scree plot for component selection

biplot

Display PCA biplot

loading_plot

Display component loading plots

survival_plot

Display survival curves stratified by principal component scores

showSummaries

Show comprehensive analysis summaries

showExplanations

Show detailed methodology explanations

Value

A results object containing:

results$todoa html
results$pcaSummarya table
results$componentLoadingsa table
results$coxResultsa table
results$variableImportancea table
results$modelComparisona table
results$componentSelectiona table
results$scalingSummarya table
results$methodologyExplanationa html
results$analysisSummarya html
results$screePlotan image
results$biplotan image
results$loadingPlotan image
results$survivalPlotan image

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$pcaSummary$asDF

as.data.frame(results$pcaSummary)

Examples