specificity: Compute specificity/selectivity/true negative rate

View source: R/specificity.R

specificityR Documentation

Compute specificity/selectivity/true negative rate

Description

Compute the empirical specificity/selectivity/true negative rate of a method from a series of tests. In this context, the specificity is the average proportion of the population of the true null region that lies outside the most likely cluster. The function requires the null test statistics, the results from the observed data sets (i.e., the maximum test statistic and most likely cluster from each data set), the true hotspot locations, and the vector of population sizes for each region. See Details.

Usage

specificity(tnull, tdata, hotspot, pop, alpha = c(0.05, 0.01))

selectivity(tnull, tdata, hotspot, pop, alpha = c(0.05, 0.01))

tnr(tnull, tdata, hotspot, pop, alpha = c(0.05, 0.01))

Arguments

tnull

The set of null test statistics

tdata

The list of maximum test statistics (tmax) and most likely cluster (mlc) for each simulated data set.

hotspot

A vector containing the hotspot indices for the current data set.

pop

A vector with the populations associated with each region.

alpha

The type I error rate. Default is c(0.05, 0.01).

Details

In this context, the specificity is the proportion of the true null region population lying outside the most likely cluster, averaged over all tests.

Value

A vector of specificity values.

Examples

tnull = 1:99
tdata = list(list(tmax = 96, mlc = c(50, 51)),
             list(tmax = 101, mlc = c(48, 57)))
specificity(tnull, tdata, 50, pop = rep(10, 100))

jpfrench81/neastbenchmark documentation built on July 26, 2023, 3:07 p.m.