Skip to contents

Introduction

The JointODE package implements joint modeling of longitudinal biomarker trajectories and survival outcomes using ordinary differential equations (ODEs). This approach captures complex biomarker dynamics while accounting for their association with event times.

Installation

# Install from GitHub
devtools::install_github("ziyangg98/JointODE")

# Load the package
library(JointODE)

Quick Start

Data Preparation

The package requires two data frames:

  1. Longitudinal data: Repeated biomarker measurements
  2. Survival data: Time-to-event outcomes
# Example longitudinal data structure
# id: subject identifier
# time: measurement time
# v: biomarker value
head(longitudinal_data)

# Example survival data structure
# id: subject identifier
# time: observation time
# status: event indicator (1=event, 0=censored)
# w1, w2: baseline covariates
head(survival_data)

Model Fitting

# Fit joint ODE model
fit <- JointODE(
  longitudinal_data = longitudinal_data,
  survival_data = survival_data,
  longitudinal_formula = v ~ 1,
  survival_formula = Surv(time, status) ~ w1 + w2,
  id = "id",
  time = "time"
)

# View results
summary(fit)

Model Diagnostics

# Check convergence
plot(fit, type = "convergence")

# Residual diagnostics
plot(fit, type = "residuals")

# Fitted trajectories
plot(fit, type = "trajectories", subjects = 1:6)

Next Steps