An R package for generating correlated oncology endpoints (OS, PFS, Response) in clinical trial simulations.
Documentation: Visit our pkgdown website for comprehensive documentation.
The CorOncoEndpoints package provides a comprehensive set of functions to generate correlated oncology endpoints with appropriate constraints and correlation structures using copula models. This package is particularly useful for simulation studies in oncology clinical trials where multiple endpoints need to be modeled with realistic dependencies.
📚 Visit our documentation website for detailed guides and examples.
- Flexible Endpoint Generation: Generate OS only, PFS only, Response only, or any combination of these endpoints
- Copula-Based Correlation: Support for Clayton and Frank copulas to model dependence structures
- Appropriate Constraints: Automatically ensures PFS ≤ OS when both endpoints are generated
- Multi-Group Support: Generate data for multiple treatment groups simultaneously
- Validation Tools: Built-in functions to validate simulation results against theoretical values
- Correlation Bounds: Calculate feasible correlation ranges based on Fréchet-Hoeffding bounds
You can install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("gosukehommaEX/CorOncoEndpoints")📖 Comprehensive guides available on our pkgdown website
Explore our detailed vignettes:
- Introduction to CorOncoEndpoints - Get started with basic usage and examples
- Advanced Usage and Examples - Complex scenarios and sensitivity analyses
- Theoretical Background - Mathematical foundations and derivations
You can also access vignettes locally after installation:
# View vignette in R
vignette("introduction", package = "CorOncoEndpoints")
vignette("advanced-usage", package = "CorOncoEndpoints")
vignette("theoretical-background", package = "CorOncoEndpoints")
# List all available vignettes
browseVignettes("CorOncoEndpoints")rOncoEndpoints(): Generate correlated endpoints (OS, PFS, Response) for multiple groups- Supports 7 different endpoint patterns
- Handles multiple treatment groups
- Ensures PFS ≤ OS constraint automatically
CheckSimResults(): Validate simulation results against theoretical values- Calculates bias, relative bias, SE, MSE, and RMSE
- Compares empirical estimates with theoretical expectations
-
CorResponsePFS(): Calculate PFS-Response correlation in the OS-PFS-Response framework- Useful for understanding implied correlations when all three endpoints are generated
-
CorBoundResponsePFS(): Compute correlation bounds for PFS-Response- Accounts for hazard rates in the three-endpoint model
-
CorBoundResponseTTE(): Compute general correlation bounds for TTE-Response- Based on Fréchet-Hoeffding bounds
- Depends only on response probability
CopulaParamResponseTTE(): Calculate copula parameters for a given correlation- Converts correlation to copula parameter (theta)
- Supports Clayton and Frank copulas
library(CorOncoEndpoints)
set.seed(123)
data1 <- rOncoEndpoints(
nsim = 100,
group = c("Treatment", "Control"),
n = c(150, 150),
p = c(0.4, 0.3),
hazard_OS = c(0.05, 0.07),
rho_tte_resp = c(0.3, 0.2),
copula = "Clayton"
)
head(data1)set.seed(456)
data2 <- rOncoEndpoints(
nsim = 100,
group = c("Experimental", "Standard"),
n = c(200, 200),
p = c(0.5, 0.35),
hazard_OS = c(0.04, 0.06),
hazard_PFS = c(0.08, 0.10),
rho_tte_resp = c(0.4, 0.25),
copula = "Frank"
)
# Check correlation between OS and Response
with(subset(data2, Group == "Experimental"), cor(OS, Response))
# Check correlation between PFS and Response (implied)
with(subset(data2, Group == "Experimental"), cor(PFS, Response))
# Verify PFS <= OS constraint
with(data2, all(PFS <= OS)) # Should be TRUEset.seed(789)
sim_data <- rOncoEndpoints(
nsim = 1000,
group = c("Treatment", "Control"),
n = c(100, 100),
p = c(0.4, 0.3),
hazard_OS = c(0.05, 0.07),
hazard_PFS = c(0.08, 0.10),
rho_tte_resp = c(0.3, 0.2),
copula = "Clayton"
)
validation <- CheckSimResults(
dataset = sim_data,
p = c(Treatment = 0.4, Control = 0.3),
hazard_OS = c(Treatment = 0.05, Control = 0.07),
hazard_PFS = c(Treatment = 0.08, Control = 0.10),
rho_tte_resp = c(Treatment = 0.3, Control = 0.2),
copula = "Clayton"
)
print(validation, n = Inf)# General TTE-Response bounds (depends only on p)
CorBoundResponseTTE(p = 0.4)
# PFS-Response bounds in OS-PFS-Response framework
CorBoundResponsePFS(
p = 0.4,
hazard_OS = 0.05,
hazard_PFS = 0.08
)
# Calculate implied PFS-Response correlation
CorResponsePFS(
p = 0.4,
hazard_OS = 0.05,
hazard_PFS = 0.08,
rho_OS_Response = 0.3,
copula = "Clayton"
)# Calculate theta for Clayton copula
theta_clayton <- CopulaParamResponseTTE(
p = 0.4,
rho = 0.3,
copula = "Clayton"
)
# Calculate theta for Frank copula
theta_frank <- CopulaParamResponseTTE(
p = 0.4,
rho = 0.3,
copula = "Frank"
)
cat("Clayton theta:", theta_clayton, "\n")
cat("Frank theta:", theta_frank, "\n")The rOncoEndpoints() function supports seven different patterns:
- OS only: Generate overall survival data
- PFS only: Generate progression-free survival data
- Response only: Generate binary response data
- OS + Response: Correlated OS and Response
- PFS + Response: Correlated PFS and Response
- OS + PFS: Correlated OS and PFS (with PFS ≤ OS)
- OS + PFS + Response: All three endpoints correlated (with PFS ≤ OS)
- Exhibits lower tail dependence
- Cannot model negative dependence (rho > 0 only)
- Good for modeling positive associations in survival data
- Flexible for both positive and negative dependence
- Symmetric tail behavior
- Suitable for a wider range of correlation structures
This package implements methods based on:
-
Fleischer Model (2009): Framework for modeling dependence between OS and PFS
- PFS = min(OS, TTP) where TTP is time to progression
- Ensures PFS ≤ OS constraint automatically
-
Copula Theory: Fréchet-Hoeffding bounds and copula-based dependence modeling
- Clayton copula for lower tail dependence
- Frank copula for flexible symmetric dependence
-
Correlation Bounds: Based on Fréchet-Hoeffding copula bounds
- Determines feasible correlation ranges
- Accounts for marginal distributions
-
Fleischer, F., Gaschler-Markefski, B., & Bluhmki, E. (2009). A statistical model for the dependence between progression-free survival and overall survival. Statistics in Medicine, 28(21), 2669-2686.
-
Trivedi, P. K., & Zimmer, D. M. (2005). Copula modeling: an introduction for practitioners. Foundations and Trends in Econometrics, 1(1), 1-111.
-
Hofert, M., Kojadinovic, I., Maechler, M., & Yan, J. (2018). Elements of copula modeling with R. Springer.
-
Nelsen, R. B. (2006). An introduction to copulas (2nd ed.). Springer.
If you use this package in your research, please cite:
Homma, G. (2025). CorOncoEndpoints: Generate Correlated Oncology Endpoints for Clinical
Trial Simulations. R package version 0.1.0.
https://github.com/gosukehommaEX/CorOncoEndpoints
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
Before contributing, please check:
If you encounter any problems or have suggestions, please file an issue at: https://github.com/gosukehommaEX/CorOncoEndpoints/issues
Gosuke Homma