Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

diagtest

Calculate diagnostic tests for 2x2 table


Description

Calculate prevalence, sensitivity, specificity, and positive and negative predictive values

Usage

diagtest(
  table,
  positive = 2,
  exact = FALSE,
  p0 = NA,
  confint = c("logit", "arcsin", "pseudoscore", "exact"),
  ...
)

Arguments

table

Table or (matrix/data.frame with two columns)

positive

Switch reference

exact

If TRUE exact binomial proportions CI/test will be used

p0

Optional null hypothesis (test prevalenc, sensitivity, ...)

confint

Type of confidence limits

...

Additional arguments to lower level functions

Details

Table should be in the format with outcome in columns and test in rows. Data.frame should be with test in the first column and outcome in the second column.

Author(s)

Klaus Holst

Examples

M <- as.table(matrix(c(42,12,
                       35,28),ncol=2,byrow=TRUE,
                     dimnames=list(rater=c("no","yes"),gold=c("no","yes"))))
diagtest(M,exact=TRUE)

lava

Latent Variable Models

v1.6.10
GPL-3
Authors
Klaus K. Holst [aut, cre], Brice Ozenne [ctb], Thomas Gerds [ctb]
Initial release
2021-09-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.