thresTH2: Population-based threshold calculation (two-state setting)

View source: R/ThresholdROC-2states.R

thresTH2R Documentation

Population-based threshold calculation (two-state setting)

Description

This function estimates the theoretical optimum threshold for the specific distribution parameters, decision costs and disease prevalence in a two-state setting.

Usage

thresTH2(dist1, dist2, par1.1, par1.2, par2.1, par2.2, rho,
  costs = matrix(c(0, 0, 1, (1 - rho)/rho), 2, 2, byrow = TRUE), 
  R=NULL, q1 = 0.05, q2 = 0.95, tol = 10^(-8))

Arguments

dist1

distribution to be assumed for the healthy population. See Details.

dist2

distribution to be assumed for the diseased population. See Details.

par1.1

first parameter of the distribution chosen for the healthy population.

par1.2

second parameter of the distribution chosen for the healthy population.

par2.1

first parameter of the distribution chosen for the diseased population.

par2.2

second parameter of the distribution chosen for the diseased population.

rho

disease prevalence.

costs

cost matrix. Costs should be entered as a 2x2 matrix, where the first row corresponds to the true positive and true negative costs and the second row to the false positive and false negative costs. Default cost values are a combination of costs that yields R=1, which is equivalent to the Youden index method (for details about this concept, see References). It must be set to NULL if the user prefers to set R (see next argument).

R

if the cost matrix costs is not set, R desired (the algorithm will choose a suitable combination of costs that leads to R). Default, NULL (which leads to R=1 using the default costs).

q1

probability of the left distribution in order to determine a low quantile. Default, 0.05.

q2

probability of the right distribution in order to determine a high quantile. Default, 0.95.

tol

tolerance to be used in function uniroot. Default, 10^(-8).

Details

Parameters dist1 and dist2 can be chosen between the following 2-parameter distributions: "beta", "cauchy", "chisq" (chi-squared), "gamma", "lnorm" (lognormal), "logis" (logistic), "norm" (normal) and "weibull".

Value

An object of class thresTH2, which is a list with five components:

thres

threshold estimate.

prev

disease prevalence provided by the user.

costs

cost matrix provided by the user.

R

R term, the product of the non-disease odds and the cost ratio (for further details about this concept, see References).

method

method used in the estimation. For an object of class thresTH2 it is always equal to "theoretical" (meaning that the population-based method has been used).

Note

It is assumed that dist1 is the distribution with lower values. If not, dist1 and dist2 (and the corresponding parameters) are exchanged.

References

Skaltsa K, Jover L, Carrasco JL. (2010). Estimation of the diagnostic threshold accounting for decision costs and sampling uncertainty. Biometrical Journal 52(5):676-697.

Examples

# example 1
dist1 <- "norm"
dist2 <- "norm"
par1.1 <- 0
par1.2 <- 1
par2.1 <- 2
par2.2 <- 1
rho <- 0.1

thresTH2(dist1, dist2, par1.1, par1.2, par2.1, par2.2, rho)


# example 2
dist1 <- "norm"
dist2 <- "lnorm"
par1.1 <- 0
par1.2 <- 1
par2.1 <- 1
par2.2 <- 0.5
rho <- 0.3

thresTH2(dist1, dist2, par1.1, par1.2, par2.1, par2.2, rho)

ThresholdROC documentation built on Aug. 30, 2023, 1:08 a.m.