plot.thres2 {ThresholdROC} | R Documentation |
Threshold and density plot (two-state setting)
Description
This function provides a graph including the sample densities (diseased and non-diseased populations), the threshold and its confidence interval.
Usage
## S3 method for class 'thres2'
plot(x, bw = c("nrd0", "nrd0"), ci = TRUE,
which.boot = c("norm", "perc"), col = c(1, 2, 3),
lty = c(1, 1, 1, 2), lwd = c(1, 1, 1),
legend = TRUE, leg.pos = "topleft", leg.cex = 1,
xlim = NULL, ylim = NULL,
main = paste0("Threshold estimate ", ifelse(ci, "and CI ", ""),
"(method ", x$T$method, ")"),
xlab = "", ...)
Arguments
x |
an object of class |
bw |
vector containing the bandwith for the non-diseased sample in the first position and the bandwith for the diseased sample in the second position (to be passed to |
ci |
should the confidence interval be plotted? Default, |
which.boot |
in case |
col |
a 3-dimensional vector containing:
Default, |
lty |
a 4-dimensional vector containing:
Default, |
lwd |
a 3-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 both samples and vertical lines representing the threshold and its confidence limits are drawn.
References
Skaltsa K, Jover L, Carrasco JL. (2010). Estimation of the diagnostic threshold accounting for decision costs and sampling uncertainty. Biometrical Journal 52(5):676-697.
See Also
Examples
n1 <- 100
n2 <- 100
set.seed(1234)
par1.1 <- 0
par1.2 <- 1
par2.1 <- 2
par2.2 <- 1
rho <- 0.2
k1 <- rnorm(n1, par1.1, par1.2) # non-diseased
k2 <- rnorm(n2, par2.1, par2.2) # diseased
thres <- thres2(k1, k2, rho, method="eq", ci.method="d")
plot(thres, col=c(1, 2, 4), lwd=c(2, 2, 1), leg.pos="topright")