# Basics:
plot_curve() # default curve plot, same as:
# plot_curve(what = c("prev", "PPV", "NPV"), uc = 0, prev_range = c(0, 1))
# Showing no/multiple prev values/points and uncertainty ranges:
plot_curve(prev = NA) # default curves without prev value (and point) shown
plot_curve(show_points = FALSE, uc = .10) # curves w/o points, 10% uncertainty range
plot_curve(prev = c(.10, .33, .75)) # 3 prev values, with numeric point labels
plot_curve(prev = c(.10, .33, .75), p_lbl = "no", uc = .10) # 3 prev, no labels, 10% uc
# Provide local parameters and select curves:
plot_curve(prev = .2, sens = .8, spec = .6, what = c("PPV", "NPV", "acc"), uc = .2)
# Selecting curves: what = ("prev", "PPV", "NPV", "ppod", "acc") = "all"
plot_curve(prev = .3, sens = .9, spec = .8, what = "all") # all curves
# plot_curve(what = c("PPV", "NPV")) # PPV and NPV
plot_curve(what = c("prev", "PPV", "NPV", "acc")) # prev, PPV, NPV, and acc
# plot_curve(what = c("prev", "PPV", "NPV", "ppod")) # prev, PPV, NPV, and ppod
# Visualizing uncertainty (uc as percentage range):
plot_curve(prev = .2, sens = .9, spec = .8, what = "all",
uc = .10) # all with a 10% uncertainty range
# plot_curve(prev = .3, sens = .9, spec = .8, what = c("prev", "PPV", "NPV"),
# uc = .05) # prev, PPV and NPV with a 5% uncertainty range
# X-axis on linear vs. log scale:
plot_curve(prev = .01, sens = .9, spec = .8) # linear scale
plot_curve(prev = .01, sens = .9, spec = .8, log_scale = TRUE) # log scale
# Several small prev values:
plot_curve(prev = c(.00001, .0001, .001, .01, .05),
sens = .9, spec = .8, log_scale = TRUE)
# Zooming in by setting prev_range (of prevalence values):
plot_curve(prev = c(.25, .33, .40), prev_range = c(.20, .50),
what = "all", uc = .05)
# Probability labels:
plot_curve(p_lbl = "abb", what = "all") # abbreviated names
plot_curve(p_lbl = "nam", what = "all") # names only
plot_curve(p_lbl = "num", what = "all") # numeric values only
plot_curve(p_lbl = "namnum", what = "all") # names and values
# Text and color settings:
plot_curve(main = "Tiny text labels", p_lbl = "namnum", cex_lbl = .60)
plot_curve(main = "Specific colors", what = "all",
uc = .1, what_col = c("grey", "red3", "green3", "blue3", "gold"))
plot_curve(main = "Black-and-white print version",
what = "all", col_pal = pal_bwp)
Run the code above in your browser using DataLab