View source: R/plot_lr_distribution.R
| plot_lr_distribution | R Documentation |
Creates a density plot showing the expected log10(LR) distributions under both hypotheses:
H1 (Related/Blue): Distribution when POI is the missing person
H2 (Unrelated/Red): Distribution when POI is unrelated
This visualization helps assess the discriminatory power of the evidence and identify potential overlap between the two hypotheses.
plot_lr_distribution(datasim)
datasim |
A data.frame with columns |
If the input is a list (output from sim_lr_genetic), it is
automatically converted to a data.frame using lr_to_dataframe.
The x-axis shows log10(LR), which is more interpretable than raw LR values:
log10(LR) = 0 means LR = 1 (neutral evidence)
log10(LR) > 0 means evidence favors H1 (related)
log10(LR) < 0 means evidence favors H2 (unrelated)
Less overlap between distributions indicates better discrimination.
A ggplot2 object showing overlaid density curves.
Blue area represents H1 (Related), red area represents H2 (Unrelated).
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_decision_curve for FPR/FNR trade-off visualization,
decision_threshold for computing optimal thresholds,
sim_lr_genetic, sim_lr_prelim for generating input.
# Using preliminary data
lr_sims <- sim_lr_prelim("sex", numsims = 500, seed = 123)
plot_lr_distribution(lr_sims)
# Using genetic data
library(forrel)
x <- linearPed(2)
x <- setMarkers(x, locusAttributes = NorwegianFrequencies[1:5])
x <- profileSim(x, N = 1, ids = 2)
lr_genetic <- sim_lr_genetic(x, missing = 5, numsims = 50, seed = 123)
plot_lr_distribution(lr_genetic)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.