diagTab | R Documentation |
Creates a 2x2 contingency table from the data frame or matrix for the qualitative performance and reader precision of downstream analysis.
diagTab(
formula = ~.,
data,
bysort = NULL,
dimname = NULL,
levels = NULL,
rep = FALSE,
across = NULL
)
formula |
( |
data |
( |
bysort |
( |
dimname |
( |
levels |
( |
rep |
( |
across |
( |
A object MCTab
contains the 2x2 contingency table.
To be attention that if you would like to generate the 2x2 contingency table for reproducibility analysis, the original data should be long structure and using the corresponding formula.
Summary()
for object to calculate diagnostic accuracy criteria.
# For qualitative performance with wide data structure
data("qualData")
qualData %>% diagTab(formula = ~ CandidateN + ComparativeN)
qualData %>%
diagTab(
formula = ~ CandidateN + ComparativeN,
levels = c(1, 0)
)
# For qualitative performance with long data structure
dummy <- data.frame(
id = c("1001", "1001", "1002", "1002", "1003", "1003"),
value = c(1, 0, 0, 0, 1, 1),
type = c("Test", "Ref", "Test", "Ref", "Test", "Ref")
)
dummy %>%
diagTab(
formula = type ~ value,
bysort = "id",
dimname = c("Test", "Ref"),
levels = c(1, 0)
)
# For Between-Reader precision performance
data("PDL1RP")
reader <- PDL1RP$btw_reader
reader %>%
diagTab(
formula = Reader ~ Value,
bysort = "Sample",
levels = c("Positive", "Negative"),
rep = TRUE,
across = "Site"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.