jmSurface implements interpretable multi-biomarker fusion in joint longitudinal-survival models via semi-parametric association surfaces for multi-state disease processes.
# Install from CRAN
install.packages("jmSurface")library(jmSurface)
# ── Option A: Use bundled CKD/CVD/Diabetes cohort (2,000 patients) ──
dat <- load_example_data()
fit <- jmSurf(
long_data = dat$long_data,
surv_data = dat$surv_data,
covariates = c("age_baseline", "sex")
)
# Summary with EDF diagnostics
summary(fit)
# EDF table
edf_diagnostics(fit)
# Dynamic prediction for patient 1
pred <- dynPred(fit, patient_id = 1, landmark = 2, horizon = 3)
head(pred)
# Visualize association surfaces
plot_surface(fit, transition = "CKD -> CVD")
contour_heatmap(fit, transition = "CKD -> CVD")
marginal_slices(fit, transition = "CKD -> CVD")
# ── Option B: Simulate fresh data ──
sim <- simulate_jmSurface(n_patients = 500)
fit2 <- jmSurf(sim$long_data, sim$surv_data)
# ── Option C: Launch interactive Shiny app ──
run_shiny_app()The package ships with a real-scale example dataset (2,000 patients):
- longitudinal_biomarkers.csv: 68,112 biomarker
measurements (eGFR, BNP, HbA1c) - survival_events.csv:
4,701 survival rows with 9 transition types
Access via:
dat <- load_example_data() # convenience loader (returns list)
# OR directly:
path <- system.file("extdata", "longitudinal_biomarkers.csv", package = "jmSurface")
long <- read.csv(path)For each transition (r → s) in a multi-state process:
λᵢʳˢ(t | ηᵢ(t)) = λ₀ʳˢ(t) · exp{γᵣₛ'wᵢ + fᵣₛ(ηᵢ(t))}
where: - ηᵢ(t) = BLUP-based latent longitudinal
summaries (biomarker-specific) - fᵣₛ(·) = semi-parametric
association surface (tensor-product splines) - Smoothing via REML;
complexity controlled by EDF
| Function | Description |
|---|---|
jmSurf() |
Main fitting function (two-stage) |
fit_longitudinal() |
Stage 1: LME models per biomarker |
fit_gam_cox() |
Stage 2: GAM-Cox with spline surface |
edf_diagnostics() |
EDF table with complexity labels |
dynPred() |
Dynamic prediction of transition probabilities |
plot_surface() |
3D perspective surface plot |
contour_heatmap() |
Filled contour heatmap |
marginal_slices() |
Marginal effect slices at quantiles |
simulate_jmSurface() |
Simulate CKD/CVD/Diabetes data |
run_shiny_app() |
Launch interactive Shiny dashboard |
Bhattacharjee, A. (2025). Interpretable Multi-Biomarker Fusion in Joint Longitudinal-Survival Models via Semi-Parametric Association Surfaces. Under review.
Bhattacharjee, A. (2024). jmBIG: Scalable Joint Models for Big Data. CRAN.
Wood, S.N. (2017). Generalized Additive Models: An Introduction with R. Chapman & Hall/CRC.
GPL (>= 3)