Skip to content

First release of SurvIntersectR

Latest
Compare
Choose a tag to compare
@danielpestana95 danielpestana95 released this 16 May 20:49
· 1 commit to master since this release
3a53935

SurvIntersectR v0.1.0

DOI

This is the first release of SurvIntersectR, a package to detect and locate intersections of survival curves.

Features

  • Intersection Detection: Determine if survival curves intersect using the surv_curve_intersect function.
  • Intersection Points: Identify the exact points of intersection using the find_surv_intersect function.
  • Example Data: Included example datasets data_no_intersect and data_intersect to demonstrate the functionality.

Installation

To install the package, use:

devtools::install_github("danielpestana95/SurvIntersectR")

Usage Examples

Below are some basic examples to use this package

Checking if Survival Curves Intersect

library(survminer)
library(survival)
library(SurvIntersectR)

# Load example data
data("data_no_intersect", package = "SurvIntersectR")
data("data_intersect", package = "SurvIntersectR")

# Fit survival models
fit1 <- survfit(Surv(time, status) ~ group, data = data_no_intersect)
fit2 <- survfit(Surv(time, status) ~ group, data = data_intersect)

# Plot survival curves
plot1 <- ggsurvplot(fit1, data = data_no_intersect)
plot2 <- ggsurvplot(fit2, data = data_intersect)

# Check intersections
result1 <- surv_curve_intersect(plot1)  # FALSE
result2 <- surv_curve_intersect(plot2)  # TRUE

print(result1)
print(result2)

Finding Intersection Points

# Find intersection points
intersection_points <- find_surv_intersect(plot2)
print(intersection_points)

License

This project is licensed under the MIT License.

Citation

If you use SurvIntersectR in your research, please cite it as follows:

Pestana, D., Cardoso, C., & Castelo-Branco, P. (2024). SurvIntersectR: Tools for Detecting Survival Curve Intersections (v0.1.0). Zenodo. https://doi.org/10.5281/zenodo.11206042