plotRS: Plot risk scores of patients

Description Usage Arguments Examples

View source: R/plot.R

Description

Plot risk scores of patients

Usage

1
2
3
4
5
6
7
8
plotRS(
  rs,
  y.status,
  cutoff = median(rs),
  col.dead = "#E64B35",
  col.alive = "#00A087",
  legend.position = c(0.2, 0.9)
)

Arguments

rs

Risk score of patients

y.status

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.dead

The color that corresponds to 1 in y.status.

col.alive

The color that corresponds to 0 in y.status.

legend.position

Legend position.

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)

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

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