Skip to contents

Principal Component Analysis for Cox regression with high-dimensional predictors. Reduces dimensionality while preserving survival-relevant information using supervised PCA.

Usage

pcacox(
  data,
  time,
  status,
  predictors,
  clinical_vars,
  pca_method = "supervised",
  n_components = 5,
  component_selection = "cv",
  cv_folds = 10,
  variance_threshold = 0.8,
  scaling = TRUE,
  centering = TRUE,
  survival_weighting = TRUE,
  permutation_test = FALSE,
  n_permutations = 100,
  bootstrap_validation = TRUE,
  n_bootstrap = 100,
  plot_scree = TRUE,
  plot_loadings = TRUE,
  plot_biplot = TRUE,
  plot_survival = TRUE,
  risk_score = TRUE,
  pathway_analysis = FALSE,
  feature_importance = TRUE
)

Arguments

data

The data as a data frame.

time

Survival time variable

status

Event status variable

predictors

Variables for principal component analysis

clinical_vars

Clinical predictors to retain in model

pca_method

PCA methodology for dimensionality reduction

n_components

Number of PCs to include in Cox model

component_selection

Selection criteria for PCs

cv_folds

K-fold CV parameter

variance_threshold

Proportion of variance threshold

scaling

Center and scale variables

centering

Center variables to zero mean

survival_weighting

Use survival information in PCA

permutation_test

Test component significance via permutation

n_permutations

Permutation sample size

bootstrap_validation

Assess model stability via bootstrap

n_bootstrap

Bootstrap sample size

plot_scree

Generate scree plot

plot_loadings

Generate loading visualizations

plot_biplot

Generate biplot visualization

plot_survival

Generate survival stratification plots

risk_score

Calculate combined risk score

pathway_analysis

Analyze biological pathways

feature_importance

Rank features by contribution

Value

A results object containing:

results$todoa html
results$summarya html
results$pcaSummarya table
results$coxResultsa table
results$componentLoadingsa table
results$modelPerformancea table
results$featureImportancea table
results$riskScorea table
results$screePlotan image
results$loadingsPlotan image
results$biplotan image
results$survivalPlotan image
results$crossValidationa html
results$bootstrapValidationa html
results$permutationTesta html
results$pathwayAnalysisa html
results$technicalDetailsa html
results$clinicalInterpretationa html

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

results$pcaSummary$asDF

as.data.frame(results$pcaSummary)

Examples

# \donttest{
# Example usage
pcacox(
    data = highdim_data,
    time = survival_time,
    status = event_status,
    predictors = high_dimensional_variables,
    n_components = 5
)
# }