View source: R/plot_decision_curve.R
| plot_decision_curve | R Documentation |
Creates a scatter plot showing the trade-off between false positive rate (FPR) and false negative rate (FNR) across different LR threshold values. This visualization helps identify optimal decision thresholds based on the relative costs of different types of errors.
plot_decision_curve(datasim, LRmax = 1000)
datasim |
A data.frame with columns |
LRmax |
Numeric. Maximum LR value to use as threshold. Points are generated for thresholds from 1 to LRmax. Default: 1000. |
If the input is a list (output from sim_lr_genetic), it is
automatically converted to a data.frame using lr_to_dataframe.
Error Rate Definitions:
FPR: Proportion of unrelated (H2) cases with LR > threshold
FNR: Proportion of related (H1) cases with LR < threshold
Ideal point: The origin (0,0) represents perfect discrimination. Points closer to the origin indicate better thresholds.
Trade-off: Moving along the curve, decreasing FNR typically increases FPR and vice versa. The optimal point depends on the relative costs of false positives vs false negatives.
A ggplot2 scatter plot where:
X-axis: False Negative Rate (FNR) - proportion of true matches missed
Y-axis: False Positive Rate (FPR) - proportion of non-matches incorrectly identified
Each point represents a different LR threshold
The first and last threshold values are labeled on the plot.
Marsico FL, Vigeland MD, Egeland T, Herrera Pinero F (2021). "Making decisions in missing person identification cases with low statistical power." Forensic Science International: Genetics, 52, 102519. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.fsigen.2021.102519")}
plot_lr_distribution for LR distribution visualization,
decision_threshold for computing optimal threshold,
threshold_rates for error rates at a specific threshold.
# Using preliminary data
lr_sims <- sim_lr_prelim("sex", numsims = 500, seed = 123)
plot_decision_curve(lr_sims)
# With lower maximum threshold for finer resolution
plot_decision_curve(lr_sims, LRmax = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.