The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

OnlineSurr is an R package for surrogate evaluation when
both the primary outcome and the surrogate marker are measured
longitudinally. The package implements a state-space approach based on
the methodology developed in A Causal Framework for Evaluating
Jointly Longitudinal Outcomes and Surrogate Markers: A State-Space
Approach.
The current implementation fits two Gaussian state-space models:
From these two fitted models, the package produces time-specific treatment-effect estimates, bootstrap-based uncertainty summaries, estimates of the local and cumulative proportion of treatment effect explained (LPTE and CPTE), and a test for temporal homogeneity of the PTE.
The package is not yet on CRAN. Install the development version from GitHub with:
# install.packages("remotes")
remotes::install_github("silvaneojunior/OnlineSurr")Depending on your local setup, you may also need to install the package dependencies first.
The current source imports functionality from:
kDGLMdplyrtidyrrlangggplot2Rfastlatex2explibrary(OnlineSurr)
fit <- fit.surr(
formula = y ~ 1,
id = id,
surrogate = ~ s1 + s2,
treat = trt,
data = dat,
time = time,
N.boots = 500
)
summary(fit, t = fit$T, cumulative = TRUE)
plot(fit, type = "LPTE")
plot(fit, type = "CPTE")
plot(fit, type = "Delta")
time_homo_test(fit)Go here to view a tutorial for this package: OnlineSurr vignette
See Santos Jr. and Parast (2026) for details about the theoretical aspects of the package.
At its current stage, the package is focused on the core methodology and assumes that the user supplies an appropriate surrogate specification. In practice, users should pay careful attention to:
The current implementation is best viewed as a research package accompanying the methodological paper.
If you use this repository, please cite the associated paper:
Santos Jr., S. V. dos, and Parast, L. (2026). A causal framework for evaluating jointly longitudinal outcomes and surrogate markers: A state-space approach.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.