High-dimensional mediation analysis for longitudinal mediator and survival outcome data
Source:R/hima_survival_long.R
hima_survival_long.Rdhima_survival_long estimates and tests high-dimensional longitudinal mediation effects for survival data in a counting
process framework.
Usage
hima_survival_long(
X,
M,
tstart,
tstop,
status,
id,
COV = NULL,
topN = NULL,
scale = TRUE,
Bonfcut = 0.05,
verbose = FALSE,
parallel = FALSE,
ncore = 1
)Arguments
- X
A numeric vector of exposure values (do not use
data.frameormatrix).- M
A
data.frameormatrixof high-dimensional mediators (rows = observations/intervals, columns = mediators).- tstart
A numeric vector of starting times for each observation/interval (e.g., entry time in a counting-process setup).
- tstop
A numeric vector of stopping times for each observation/interval (e.g., event/censoring time in a counting-process setup).
- status
A numeric vector of censoring indicators (
1 = event,0 = censored).- id
A vector of subject identifiers (used for clustering/random effects).
- COV
A
matrixordata.frameof adjusting covariates. Rows represent samples, columns represent variables. Can beNULL.- topN
Integer specifying the number of top mediators retained after sure independent screening (SIS). If
NULL(default),topN = ceiling(n/log(n)), wherenis the number of unique subjects. WhentopNexceeds the total number of mediators, all mediators are kept (i.e., the low-dimensional scenario).- scale
Logical. Should the function scale the exposure, mediators, and covariates? Default =
TRUE.- Bonfcut
Bonferroni-corrected p value cutoff applied to select significant mediators. Default =
0.05.- verbose
Logical. Should progress messages be printed? Default =
FALSE.- parallel
Logical. Enable parallel computing for SIS? Default =
FALSE.- ncore
Integer specifying the number of cores to use when
parallel = TRUE.
Value
A data.frame containing mediation testing results of significant mediators (joint p-value < Bonfcut).
- Index
Mediator name of the selected significant mediator.
- alpha_hat
Coefficient estimates for the exposure (X) –> mediator (M) model (adjusted for covariates).
- alpha_se
Standard error for
alpha_hat.- beta_hat
Coefficient estimates for the mediator (M) –> outcome (Y) model (adjusted for covariates and exposure).
- beta_se
Standard error for
beta_hat.- IDE
Indirect (mediation) effect estimate, i.e.,
alpha_hat * beta_hat.- rimp
Relative importance of the mediator.
- pmax
joint raw p-value of selected significant mediator (based on Bonferroni method).
References
Liu L, Zhang H, Zheng Y, Gao T, Zheng C, Zhang K, Hou L, Liu L. High-dimensional mediation analysis for longitudinal mediators and survival outcomes. Briefings in Bioinformatics. 2025. DOI: 10.1093/bib/bbaf206. PMID: 40350699 PMCID: PMC12066418
Examples
if (FALSE) { # \dontrun{
data(SurvivalLongData)
pheno_data <- SurvivalLongData$PhenoData
mediator_data <- SurvivalLongData$Mediator
hima_survival_long.fit <- hima_survival_long(
X = pheno_data$Treatment,
M = mediator_data,
tstart = pheno_data$Tstart,
tstop = pheno_data$Tstop,
status = pheno_data$Status,
id = pheno_data$ID,
COV = pheno_data[, c("Sex", "Age")],
verbose = TRUE
)
hima_survival_long.fit
} # }