view_dr_surv: 2D or 2D view of survival data on reduced dimension

View source: R/view_dr_surv.r

view_dr_survR Documentation

2D or 2D view of survival data on reduced dimension

Description

Produce 2D or 3D plots of right censored survival data based on a given dimension reduction space

Usage

view_dr_surv(
  x,
  y,
  censor,
  B = NULL,
  bw = NULL,
  FUN = "log",
  type = "2D",
  legend.add = TRUE,
  xlab = "Reduced Direction",
  ylab = "Time",
  zlab = "Survival"
)

Arguments

x

A matrix or data.frame for features (continuous only). The algorithm will not scale the columns to unit variance

y

A vector of observed time

censor

A vector of censoring indicator

B

The dimension reduction subspace, can only be 1 dimensional

bw

A Kernel bandwidth (3D plot only) for approximating the survival function, default is the Silverman's formula

FUN

A scaling function applied to the time points y. Default is "log".

type

⁠2D⁠ or ⁠3D⁠ plot

legend.add

Should legend be added (2D plot only)

xlab

x axis label

ylab

y axis label

zlab

z axis label

Value

An rgl object that is rendered.

References

Sun, Q., Zhu, R., Wang, T., & Zeng, D. (2019). Counting process-based dimension reduction methods for censored outcomes. Biometrika, 106(1), 181-196. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asy064")}

Examples

# generate some survival data
N <- 100
P <- 4
dataX <- matrix(rnorm(N * P), N, P)
Y <- exp(-1 + dataX[, 1] + rnorm(N))
Censor <- rbinom(N, 1, 0.8)

orthoDr.fit <- orthoDr_surv(dataX, Y, Censor, ndr = 1, method = "dm")
view_dr_surv(dataX, Y, Censor, orthoDr.fit$B)

orthoDr documentation built on April 30, 2023, 5:12 p.m.