binTab | R Documentation |
To create a Boolean test-&-disease or risk-&-disease table.
binTab(x, ...)
## S3 method for class 'matrix'
binTab(x, ...)
## S3 method for class 'table'
binTab(x, ...)
## S3 method for class 'formula'
binTab(formula, data, ...)
x |
(an R object convertible to a) |
formula |
formula in the fashion of |
data |
a data.frame |
Function binTab creates a 2\times 2
test-&-disease contingency table with layout
Test (- ) | Test (+ ) |
|
Disease (- ) | x_{--} | x_{-+} |
Disease (+ ) | x_{+-} | x_{++} |
or a 2\times 2
risk-&-disease contingency table with layout
Risk Factor (- ) | Risk Factor (+ ) |
|
Disease (- ) | x_{--} | x_{-+} |
Disease (+ ) | x_{+-} | x_{++} |
The endpoint (i.e., disease) must be on the rows and the test/risk on the columns.
Function binTab returns a two-by-two integer matrix.
Function caret::confusionMatrix
does not provide confidence intervals of
sensitivity, specificity, etc.
binTab(matrix(c(7L, 3L, 8L, 6L), nrow = 2L))
binTab(matrix(c(7L, 3L, 8L, 6L), nrow = 2L, dimnames = list(X = c('a','b'), NULL)))
binTab(~ (mag < 4.5) + (depth > 400), data = quakes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.