set.seed(0)
count.neg <- count.pos <- 200
sd.neg <- sd.pos <- 1
mean.neg <- .5
mean.pos <- 1
skew.neg <- -8
skew.pos <- 0
x <- c(sn::rsn(count.neg,mean.neg,sd.neg,skew.neg),
sn::rsn(count.pos,mean.pos,sd.pos,skew.pos))
y <- ordered(c(rep("neg",count.neg),rep("pos",count.pos)),levels=c("neg","pos"))
r1 <- roc(y,x)
plotROC(r1,ppv=0.2,prevalence=0.05,boot.n=1e2)
skew.neg <- 0
skew.pos <- 8
x <- c(sn::rsn(count.neg,mean.neg,sd.neg,skew.neg),
sn::rsn(count.pos,mean.pos,sd.pos,skew.pos))
y <- ordered(c(rep("neg",count.neg),rep("pos",count.pos)),levels=c("neg","pos"))
r2 <- roc(y,x)
plotROC(r2,npv=0.995,prevalence=0.05,boot.n=1e2)
Run the code above in your browser using DataLab