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

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

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)
#>                         Estimate Std.Err   2.5%  97.5%  P-value
#> Prevalence                0.3419         0.2567 0.4353         
#> Test                      0.5385         0.4439 0.6310         
#> Sensitivity               0.7000         0.5347 0.8344         
#> Specificity               0.5455         0.4279 0.6594         
#> PositivePredictiveValue   0.4444         0.3192 0.5751         
#> NegativePredictiveValue   0.7778         0.6440 0.8796         
#> Accuracy                  0.5983         0.5036 0.6878         
#> Homogeneity               0.7447         0.5965 0.8606 0.001089