plotKMCurve: Plot Kaplan-Meier curve

Description Usage Arguments Examples

View source: R/plot.R

Description

Plot Kaplan-Meier curve

Usage

1
2
3
4
5
6
7
plotKMCurve(
  rs,
  y,
  cutoff = median(rs),
  col.low = "#1F77B4",
  col.high = "#FF7F0E"
)

Arguments

rs

Risk score of patients

y

The time-to-event outcome, as a two-column matrix or Surv object. The first column should be time on study (follow up time); the second column should be a binary variable with 1 indicating that the event has occurred and 0 indicating (right) censoring.

cutoff

The cut-off that is used to divided the patients into two groups according to rs.

col.low

Color used to indicate low-risk patients.

col.high

Color used to indicate high-risk patients.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load data
data(GBM)
data(PCGroup)

cv.fit1 <- cv.PCLasso(x = GBM$GBM.train$Exp,
                      y = GBM$GBM.train$survData,
                      group = PCGroup,
                      nfolds = 5)

# predict risk scores of samples in GBM.test
s <- predict(object = cv.fit1, x = GBM$GBM.test$Exp, type="link",
             lambda=cv.fit1$cv.fit$lambda.min)

plotKMCurve(rs = s, y = GBM$GBM.test$survData)

weiliu123/PCLassoCox documentation built on Dec. 23, 2021, 5:10 p.m.