8000 GitHub - vgs549/cfsurvival: An R package for conformalized survival analysis
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

An R package for conformalized survival analysis

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

vgs549/cfsurvival

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cfsurvival

An R package that implements the conformalized survival analysis methodology.

Overview

The goal of cfsurvival is to provide a lower predictive lower bound for the survival time of an individual, with the guarantee that with probability (1-$\alpha$) it is no larger than the true survival time.

Installation

To install this package, run the following command in your R console:

if (!require("devtools")){
    install.packages("devtools")
}
devtools::install_github("zhimeir/cfsurvival")

Dependencies

The following R packages (version 4.0.2) packages are required:

Usage example

# Library the package
library(cfsurvival)

# Generate data
set.seed(24601)
n <- 2000
X <- runif(n, 0, 2)
T <- exp(X + rnorm(n,0,1))
C <- rexp(n, rate = 0.05)
event <- (T <= C)
censored_T <- pmin(T, C)
data <- data.frame(X = X, C = C, event = event, censored_T = censored_T)

# Prediction point
n_test <- 1000
X_test <- runif(n_test, 0, 2)
T_test <- exp(X_test + rnorm(n,0,1))

# Running cfsurvival under completely independent censoring with c0 = 30 
c0 <- 30
pr_list <- rep(0.5, n)
pr_new_list <- rep(0.5, n_test)

# Use the Cox model
res <- cfsurv(x = X_test, c_list = c0, pr_list = pr_list, pr_new_list = pr_new_list,
             Xtrain = X, C = C, event = event, time = censored_T, 
             alpha = 0.1, model = "aft")

# Examine the result
cat(sprintf("The coverage is %.3f.\n", mean(res <= T_test)))

License

This packakge is is distributed under the MIT license.

About

An R package for conformalized survival analysis

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%
0