| view_dr_surv {orthoDr} | R 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   | 
y | 
 A   | 
censor | 
 A   | 
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   | 
type | 
 
  | 
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: 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)