netben: Calculate netbenefit curves of risk predictions

Description Usage Arguments Value Author(s) Examples

Description

Calculate netbenefit curves of risk predictions

Usage

1
netben(y.hat, y, Ngrid = NULL)

Arguments

y.hat

numeric. risk between 0 and 1

y

status yes=1, no=0 or dead=1, alive=0

Ngrid

Number of grid points. Defaults to NULL where all distint y.hat are used.

Value

data.frame with columns netben, all and threshold

Author(s)

Andi Boeck

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
require(ggplot2)
set.seed(123)
risk <- runif(30, .1, .9);
outcome <- rbinom(30, size=1, prob=risk);
bla <- netben(risk, outcome)

bla2 <- ggplot(bla, aes(x=threshold*100)) +
 geom_hline(aes(yintercept=0, linetype="No biopsies")) +
 geom_line(aes(y=all, linetype="Biopsy all"),alpha=.7, size=.4) +
 geom_line(aes(y=netben, linetype="Biopsy with risk threshold"),alpha=.7, size=.4) +
 xlab("Risk (%)") + ylab("Net benefit") +
 scale_linetype_discrete(guide = guide_legend(title=""))
print(bla2)

Atools documentation built on May 2, 2019, 6:30 p.m.

Related to netben in Atools...