Skip to contents

The JointODE package provides a unified framework for joint modeling of longitudinal biomarker measurements and time-to-event outcomes using ordinary differential equations (ODEs). This approach enables the simultaneous analysis of biomarker trajectories and their impact on survival outcomes.

Model Setup

Longitudinal Model

The observed biomarker measurements are modeled as: V_{ij}=m_i(T_{ij})+b_i+\varepsilon_{ij},\quad i=1,\ldots,n,\quad j=1,\ldots,n_i

where:

  • V_{ij}: Observed biomarker value for subject i at time T_{ij}
  • m_i(t): True underlying biomarker trajectory
  • b_i\sim\mathcal{N}(0,\sigma_{b}^{2}): Subject-specific random intercept
  • \varepsilon_{ij}\sim\mathcal{N}(0,\sigma_{e}^{2}): Measurement error

The biomarker trajectory evolution is characterized by the following second-order differential equation:

\ddot{m}_i(t) = f\big(m_i(t), \dot{m}_i(t), \mathbf{X}_i(t), t\big)

where f: \mathbb{R} \times \mathbb{R} \times \mathbb{R}^p \times \mathbb{R}^+ \to \mathbb{R} is a smooth function modeling the biomarker acceleration as a function of its current value m_i(t), velocity \dot{m}_i(t), time-varying covariates \mathbf{X}_i(t) \in \mathbb{R}^p, and time t.

Survival Model

The hazard function incorporates biomarker dynamics:

\lambda_i(t) = \lambda_{0}(t)\exp\left[\mathbf{m}_i(t)^{\top}\boldsymbol{\alpha}+\mathbf{W}_i^{\top}\boldsymbol{\phi}+b_{i}\right]

where:

  • \lambda_{0}(t): Baseline hazard (e.g., Weibull, piecewise constant)
  • \mathbf{m}_i(t)=\left(m_i(t), \dot{m}_i(t), \ddot{m}_i(t)\right)^{\top}: Biomarker value and derivatives
  • \boldsymbol{\alpha}=(\alpha_0, \alpha_1, \alpha_2)^{\top}: Association parameters for value, velocity, and acceleration
  • \mathbf{W}_i: Baseline covariates with coefficients \boldsymbol{\phi}
  • b_i: Subject-specific random intercept

For detailed mathematical derivations including ODE formulation, likelihood construction, and EM algorithm specifics, see the technical documentation.

Installation

You can install the development version of JointODE from GitHub with:

# install.packages("pak")
pak::pak("ziyangg98/JointODE")

Example

Here’s a basic example demonstrating typical usage:

library(JointODE)
## basic example code

Using README.Rmd instead of README.md allows you to include executable R chunks:

summary(cars)
#>      speed           dist
#>  Min.   : 4.0   Min.   :  2.00
#>  1st Qu.:12.0   1st Qu.: 26.00
#>  Median :15.0   Median : 36.00
#>  Mean   :15.4   Mean   : 42.98
#>  3rd Qu.:19.0   3rd Qu.: 56.00
#>  Max.   :25.0   Max.   :120.00

Remember to render README.Rmd regularly to keep README.md up-to-date. Use devtools::build_readme() for this task.

You can also embed plots:

Remember to commit and push the resulting figure files to ensure they display on GitHub and CRAN.

Code of Conduct

Please note that the JointODE project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.