8000 GitHub - uno1lab/survQDiff: Graphical Procedures for Evaluating Overall and Subject-Specific Incremental Values from New Predictors with Censored Event Time Data · GitHub
[go: up one dir, main page]

Skip to content
uno1labPublic

About

Graphical Procedures for Evaluating Overall and Subject-Specific Incremental Values from New Predictors with Censored Event Time Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

survQDiff

survQDiff is an R package that implements graphical procedures for evaluating overall and subject-specific incremental values from new predictors with censored event time data, as described in:

Uno H, Cai T, Tian L, Wei LJ. Graphical procedures for evaluating overall and subject-specific incremental values from new predictors with censored event time data. Biometrics. 2011 Dec;67(4):1389–96. doi:10.1111/j.1541-0420.2011.01568.x

Overview

The package provides:

  • Local linear quantile regression (loc.qreg, loc.qreg.opt) with automatic bandwidth selection via k-fold cross-validation
  • Inverse probability of censoring weighting (WGT.FUN, Ghat.FUN) for handling censored survival data
  • Cox model risk estimation (Est.HR.FUN) for extracting predicted event probabilities and linear predictors
  • Plotting utilities (shade) for visualizing conditional quantile bands

Installation

Install directly from GitHub using devtools:

# install.packages("devtools")
devtools::install_github("uno1lab/survQDiff")

Or using pak:

# install.packages("pak")
pak::pkg_install("uno1lab/survQDiff")

Quick Start

library(survQDiff)
library(survival)

# Prepare data (PBC dataset from the survival package)
D <- subset(pbc, select = c("time", "status", "age", "albumin",
                             "edema", "protime", "bili"))
D <- D[!is.na(rowMeans(D)), ]
D$status <- as.numeric(D$status == 2)

t0 <- 365 * 5  # 5-year prediction horizon

# Fit Cox models (with and without a new biomarker)
ft1 <- Est.HR.FUN(as.matrix(D),        t0)  # full model
ft0 <- Est.HR.FUN(as.matrix(D[, -7]),  t0)  # reduced model

# Compute IPCW weights
Wi <- WGT.FUN(D[, c("time", "status")], t0)

# Transform predictions to log-log scale
xx <- log(-log(pmin(ft0$risk, 0.9999)))
yy <- log(-log(pmin(ft1$risk, 0.9999)))

# Fit local median regression for cases (subjects with events)
case <- cbind(xx, yy, Wi)[D$status == 1 & Wi > 0, ]
fit  <- loc.qreg.opt(case, tau = 0.5, bw.ini = var(xx),
                     mykern = "gauss", kfold = 5)

# Plot
plot(exp(-exp(fit$ft)), type = "l", xlab = "P1", ylab = "Median D")

See vignette("qsmooth-pbc-example", package = "survQDiff") for a full worked example reproducing the figures from the paper.

Citation

citation("survQDiff")
Uno H, Cai T, Tian L, Wei LJ (2011). Graphical procedures for evaluating
overall and subject-specific incremental values from new predictors with
censored event time data. Biometrics, 67(4), 1389-1396.
doi:10.1111/j.1541-0420.2011.01568.x

License

GPL-3. See LICENSE for details.

About

Graphical Procedures for Evaluating Overall and Subject-Specific Incremental Values from New Predictors with Censored Event Time Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0