da: Calculate diagnostic accuracy measures for binary measures...

View source: R/da.R

daR Documentation

Calculate diagnostic accuracy measures for binary measures (test, reference standard)

Description

Calculate diagnostic accuracy measures for binary measures (test, reference standard) and confidence intervals (two sided binomial for all the indexes except PPV and NPV, calculated via bdpv a-la Mercaldo)

Usage

da(
  test = NULL,
  refstd = NULL,
  alpha = 0.05,
  digits = 4L,
  positive_first = TRUE,
  ppv_npv_prev = NULL,
  ppv_npv_force_unadj = FALSE
)

Arguments

test

test variable (dichotomic factor or logical)

refstd

reference standard (dichotomic factor or logical)

alpha

type I error for two sided confidence interval

digits

rounding digits

positive_first

logical: display positive test and reference standard in first row column

ppv_npv_prev

prevalence adopted for ppv and npv confidence interval (if NULL it's estimated from sample)

ppv_npv_force_unadj

force unadjusted (standard logit) ppv npv estimates (and confidence interval) if at least one between NPV or PPV is 0 or 1

Examples


## CASS Example (Pepe pag 22)
db <- dadb(tn = 327, fn = 208, fp = 115, tp = 815)
with(db, da(test = test, refstd = refstd))

## Alzheimer Example (Mercaldo 2007)
db <- dadb(tn = 288, fn = 178 , fp = 87, tp = 240)
with(db, da(test = test, refstd = refstd, ppv_npv_prev = .03))


lbraglia/lbdiag documentation built on July 29, 2023, 3:35 p.m.