Skip to contents

Simulates the sighting category and therapy concept a participant assigns to each casualty, using the published per-category hit rates. Where the participant is wrong, the miscall is drawn from the neighbouring categories, since confusing red with yellow is far more likely than confusing red with green.

Usage

sdt_add_decisions(cohort, hit = NULL, therapy_hit = 0.75, seed = NULL)

Arguments

cohort

A cohort from sdt_cohort() or sdt_synthetic_cohort().

hit

Named numeric vector of per-category hit rates. Defaults to the published triage_hit.

therapy_hit

Scalar probability that the therapy concept is called correctly.

seed

Optional integer seed, applied with withr::local_seed().

Value

The cohort with two added columns: called_triage and called_therapy, the participant's calls.

See also

sdt_consistency_score() to score the calls against the truth.

Examples

co <- sdt_synthetic_cohort(n = 200, seed = 1)
called <- sdt_add_decisions(co, seed = 2)
sdt_consistency_score(called$triage, called$called_triage)
#> # A tibble: 1 × 4
#>   .metric .estimator .estimate     n
#>   <chr>   <chr>          <dbl> <int>
#> 1 kap     multiclass     0.611   200

# Hit rate per true category, against the published targets.
table(called$triage, called$called_triage)
#>         
#>          green red yellow
#>   green     49   9     15
#>   red        6  67      8
#>   yellow     4   9     33