tab.paired: Tabulate Results from Two Binary Diagnostic Tests in a Paired...

View source: R/DTComPair.R

tab.pairedR Documentation

Tabulate Results from Two Binary Diagnostic Tests in a Paired Study Design

Description

Produces contingency tables of results from two binary diagnostic tests evaluated in a paired study design.

Usage

tab.paired(d, y1, y2, data = NULL, testnames, ...)

Arguments

d

A numeric vector specifying the gold-standard results (1 = presence of disease, 0 = absence of disease).

y1

A numeric vector specifying the results of diagnostic test 1 (1 = positive, 0 = negative).

y2

A numeric vector specifying the results of diagnostic test 2 (1 = positive, 0 = negative).

data

An optional data frame, list or environment containing the required variables d, y1 and y2.

testnames

An optional vector specifying the names of diagnostic test 1 and diagnostic test 2, e.g. c("Test A","Test B"). If not supplied, the variable names are used as testnames.

...

Additional arguments (usually not required).

Value

Returns a list of class tab.paired:

diseased

A contingency table (matrix) of test results among diseased subjects.

Test1 pos. Test1 neg. Total
Test2 pos. ... ... ...
Test2 neg. ... ... ...
Total ... ... ...
non.diseased

A contingency table (matrix) of test results among non-diseased subjects.

Test1 pos. Test1 neg. Total
Test2 pos. ... ... ...
Test2 neg. ... ... ...
Total ... ... ...
testnames

The names of the diagnostic tests.

Note

Objects of class tab.paired are essential arguments for various functions in the DTComPair-package.

See Also

print.tab.paired, read.tab.paired, tab.1test.

Examples

data(Paired1) # Hypothetical study data 
b <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
str(b)
b$diseased
b$non.diseased
print(b)

DTComPair documentation built on Aug. 20, 2023, 5:06 p.m.