R/plot_curve.R
plot_curve.Rd
plot_curve
draws curves of selected values
(including PPV
, NPV
)
as a function of the prevalence (prev
)
for given values of
sensitivity sens
(or
miss rate mirt
) and
specificity spec
(or
false alarm rate fart
).
plot_curve(prev = num$prev, sens = num$sens, mirt = NA, spec = num$spec, fart = NA, what = c("prev", "PPV", "NPV"), what_col = pal, uc = 0, show_points = TRUE, log_scale = FALSE, lbl_txt = txt, title_lbl = NA, p_lbl = "def", cex_lbl = 0.85, col_pal = pal, mar_notes = TRUE, ...)
prev  The condition's prevalence 

sens  The decision's sensitivity 
mirt  The decision's miss rate 
spec  The decision's specificity 
fart  The decision's false alarm rate 
what  Vector of character codes that specify the
selection of curves to be plotted. Currently available
options are 
what_col  Vector of colors corresponding to the elements
specified in 
uc  Uncertainty range, given as a percentage of the current

show_points  Boolean value for showing the point of
intersection with the current prevalence 
log_scale  Boolean value for switching from a linear
to a logarithmic xaxis.
Default: 
lbl_txt  Labels and text elements.
Default: 
title_lbl  Main plot title.
Default: 
p_lbl  Type of label for shown probability values, with the following options:

cex_lbl  Scaling factor for the size of text labels
(e.g., on axes, legend, margin text).
Default: 
col_pal  Color palette (if what_col is unspecified).
Default: 
mar_notes  Boolean value for showing margin notes.
Default: 
...  Other (graphical) parameters. 
plot_curve
is a generalization of
plot_PV
(see legacy code)
that allows for additional dependent values.
comp_prob
computes current probability information;
prob
contains current probability information;
comp_freq
computes current frequency information;
freq
contains current frequency information;
num
for basic numeric parameters;
txt
for current text settings;
pal
for current color settings.
Other visualization functions: plot.riskyr
,
plot_area
, plot_bar
,
plot_fnet
, plot_icons
,
plot_mosaic
, plot_plane
,
plot_prism
, plot_tab
,
plot_tree
# Basics: # (1) Plot current freq and prob values: plot_curve() # default curve plot,# same as: # plot_curve(what = c("prev", "PPV", "NPV")) # hide points and show uncertainty: plot_curve(show_points = FALSE, uc = .10) # default w/o points, 10% uncertainty range# (2) Provide local parameters and select curves: plot_curve(prev = .2, sens = .8, spec = .6, what = c("PPV", "NPV", "acc"), uc = .2)# All curves: what = ("prev", "PPV", "NPV", "ppod", "acc") plot_curve(prev = .3, sens = .9, spec = .8, what = "all", col_pal = pal_org) # all curves.# Visualizing uncertainty (uc as percentage range): plot_curve(prev = .3, sens = .9, spec = .8, what = c("prev", "PPV", "NPV"), uc = .05) # => prev, PPV and NPV with a 5% uncertainty rangeplot_curve(prev = .2, sens = .8, spec = .7, what = "all", uc = .10) # => all with a 10% uncertainty range# Xaxis as linear vs. log scale: plot_curve(prev = .01, sens = .9, spec = .8) # linear scaleplot_curve(prev = .01, sens = .9, spec = .8, log_scale = TRUE) # log scaleplot_curve(prev = .0001, sens = .7, spec = .6) # linear scaleplot_curve(prev = .0001, sens = .7, spec = .6, log_scale = TRUE) # log scale# Probability labels: plot_curve(p_lbl = "abb", what = "all") # abbreviated namesplot_curve(p_lbl = "nam", what = "all") # names onlyplot_curve(p_lbl = "num", what = "all") # numeric values onlyplot_curve(p_lbl = "namnum", what = "all") # names and values# Text and color settings: plot_curve(title_lbl = "Testing tiny text labels", cex_lbl = .60)plot_curve(title_lbl = "Testing specific colors", uc = .05, what = "all", what_col = c("grey", "red3", "green3", "blue3", "gold"))plot_curve(title_lbl = "Testing color palette", uc = .05, what = "all", col_pal = pal_org)