This is a wrapper function that takes output from the `sens_spec_calc()` function and constructs values for the Receiver Operating Characteric (ROC) curve
sens_spec_roc( cutoff, mut_rate, mean_gens_pdf, max_link_gens = 1, max_gens = NULL, max_dist = NULL )
cutoff | the maximum genetic distance at which to consider cases linked |
---|---|
mut_rate | mean number of mutations per generation, assumed to be poisson distributed |
mean_gens_pdf | the density distribution of the mean number of generations between cases; the index of this vector is assumed to be the discrete distance between cases |
max_link_gens | the maximium generations of separation for linked pairs |
max_gens | the maximum number of generations to consider, if |
max_dist | the maximum distance to calculate, if |
data frame with cutoff, sensitivity, and 1-specificity
Other mutrate_functions:
gen_dists()
,
get_optim_roc()
,
sens_spec_calc()
Shirlee Wohl and Justin Lessler
# ebola-like pathogen R <- 1.5 mut_rate <- 1 # use simulated generation distributions data("gen_dist_sim") mean_gens_pdf <- as.numeric(gen_dist_sim[gen_dist_sim$R == R, -(1:2)]) # get theoretical genetic distance dist based on mutation rate and generation parameters dists <- as.data.frame(gen_dists(mut_rate = mut_rate, mean_gens_pdf = mean_gens_pdf, max_link_gens = 1)) dists <- reshape2::melt(dists, id.vars = "dist", variable.name = "status", value.name = "prob") # get sensitivity and specificity using the same paramters roc_calc <- sens_spec_roc(cutoff = 1:(max(dists$dist)-1), mut_rate = mut_rate, mean_gens_pdf = mean_gens_pdf)