plot.thres3 {ThresholdROC} | R Documentation |
Thresholds and density plot (three-state setting)
Description
This function provides a graph including the three sample densities, the thresholds and their confidence intervals.
Usage
## S3 method for class 'thres3'
plot(x, bw = c("nrd0", "nrd0", "nrd0"), ci = TRUE,
which.boot = c("norm", "perc"), col = c(1, 2, 3, 4),
lty = c(1, 1, 1, 1, 2), lwd = c(1, 1, 1, 1),
legend = TRUE, leg.pos = "topleft", leg.cex = 1,
xlim = NULL, ylim = NULL,
main = paste0("Threshold estimates", ifelse(ci, " and CIs", "")),
xlab = "", ...)
Arguments
x |
an object of class |
bw |
vector containing the bandwith for the first sample in the first position, the bandwith for the second sample in the second position and the bandwith for the third sample in the third position (to be passed to |
ci |
should the confidence intervals be plotted? Default, |
which.boot |
in case |
col |
a 4-dimensional vector containing:
Default, |
lty |
a 5-dimensional vector containing:
Default, |
lwd |
a 4-dimensional vector containing:
Default, |
legend |
logical asking if an automatic legend should be added to the graph. Default, |
leg.pos |
position of the legend. Default, |
leg.cex |
number that reescales the size of the legend. Ignored if |
xlim |
2-dimensional vector indicating the lower and upper limits for x-axis. Default value (NULL) sets those limits automatically. |
ylim |
2-dimensional vector indicating the lower and upper limits for y-axis. Default value (NULL) sets those limits automatically. |
main , xlab , ... |
further arguments to be passed to |
Value
Estimates of the density functions for the three samples and vertical lines representing the thresholds and their confidence limits are drawn.
References
Skaltsa K, Jover L, Fuster D, Carrasco JL. (2012). Optimum threshold estimation based on cost function in a multistate diagnostic setting. Statistics in Medicine, 31:1098-1109.
See Also
Examples
set.seed(1234)
n <- 100
k1 <- rlnorm(n)
k2 <- rnorm(n, 3, 1)
k3 <- rnorm(n, 5, 1)
rho <- c(1/3, 1/3, 1/3)
# assuming trinormality
start <- c(mean(k1), mean(k3))
thres <- thres3(k1, k2, k3, rho, dist1="norm", dist2="norm",
dist3="norm", start=start, ci.method="param")
plot(thres, leg.pos="topright")
# not assuming trinormality
thres <- thres3(k1, k2, k3, rho, dist1="lnorm", dist2="norm",
dist3="norm", ci.method="boot")
plot(thres, leg.pos="topright", which.boot="perc")