Learn R Programming

ThresholdROC (version 2.2)

thresTH2: Population-based threshold computation (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), 
  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 yield
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).

Value

  • An object of class thresTH2, which is a list with five components:
  • thresthreshold estimate.
  • prevdisease prevalence provided by the user.
  • costscost matrix provided by the user.
  • RR term, the product of the non-disease odds and the cost ratio (for further details about this concept, see References).
  • methodmethod 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).

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".

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

Run this code
# 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)

Run the code above in your browser using DataLab