plot_cpt: Plot Conditional Probability Tables Comparison

View source: R/plot_cpt.R

plot_cptR Documentation

Plot Conditional Probability Tables Comparison

Description

Creates a three-panel visualization comparing conditional probability tables (CPTs) and their resulting likelihood ratios:

  • Panel A: P(D|H2) - Population-based probabilities

  • Panel B: P(D|H1) - Missing person-based probabilities

  • Panel C: log10(LR) - Likelihood ratios for each combination

This visualization helps understand how different combinations of sex, age group, and hair color contribute to the likelihood ratio.

Usage

plot_cpt(CPT_POP, CPT_MP)

Arguments

CPT_POP

Matrix. Population-based conditional probability table, typically output from cpt_population.

CPT_MP

Matrix. Missing person-based conditional probability table, typically output from cpt_missing_person.

Details

The heatmaps use a blue gradient where darker colors indicate higher values (higher probabilities or higher LRs).

Each cell is labeled with its value rounded to 2 decimal places.

The LR panel (C) shows log10(LR), where:

  • Positive values (blue) favor H1 (related)

  • Negative values favor H2 (unrelated)

  • Zero indicates neutral evidence

Row labels indicate sex and age group combinations:

  • F-T1: Female, age within MP range

  • F-T0: Female, age outside MP range

  • M-T1: Male, age within MP range

  • M-T0: Male, age outside MP range

Column labels indicate hair color categories (1-5).

Value

A ggplot2 object with three panels arranged horizontally, showing heatmaps with cell values annotated.

References

Marsico FL, et al. (2023). "Likelihood ratios for non-genetic evidence in missing person cases." Forensic Science International: Genetics, 66, 102891. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.fsigen.2023.102891")}

See Also

cpt_population for creating the H2 table, cpt_missing_person for creating the H1 table.

Examples

# Create both CPTs
cpt_h2 <- cpt_population()
cpt_h1 <- cpt_missing_person(MPs = "F", MPc = 1)

# Visualize comparison
plot_cpt(cpt_h2, cpt_h1)

# Different MP characteristics
cpt_h1_male <- cpt_missing_person(MPs = "M", MPc = 3)
plot_cpt(cpt_h2, cpt_h1_male)

mispitools documentation built on Aug. 26, 2026, 1:08 a.m.