FAQ/sigdetinR - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the missing letters from: Lodon is th capial of nglnd

location: FAQ / sigdetinR

Using R to compute A (aprime) and b diagnostics in Zhang, J., & Mueller, S. T. (2005) for evaluating ROC diagnostics nonparametrically

(Copied from the https://sites.google.com/a/mtu.edu/whynotaprime/ weblink)

A <-function(h,f)
{
  if(f<=.5 & h>=.5)
  {
    a <- .75 + (h-f)/4 - f*(1-h)
  } else if(f<=h & h<=.5)
  {
    a <- .75 + (h-f)/4 - f/(4*h)
  } else {
    a <- .75 + (h-f)/4 - (1-h)/(4 * (1-f))
  } 
  return(a)
  }

b <- function(h,f)
{
  if(f<=.5 & h>=.5)
  {
    b <-(5-4*h)/(1+4*f)
  } else if(f<=h & h<=.5)
  {
    b <-(h^2+h)/(h^2+f) 
  } else { 
    b <- ((1-f)^2 + (1-h))/((1-f)^2 + (1-f))
  } 
  return(b)
}

Reference

Zhang, J., & Mueller, S. T. (2005). A note on ROC analysis and non-parametric estimate of sensitivity. Psychometrika, 70(1), 203–212. doi:10.1007/s11336-003-1119-8