Skip to contents

Produces a data frame which can be used by the compareR function using values commonly found in published literature. Useful for reviews and meta-analyses.

Usage

dataframeR(s11, s10, s01, s00, r11, r10, r01, r00)

Arguments

s11

Number of cases where Test 1 is positive, Test 2 is positive and gold standard is positive.

s10

Number of cases where Test 1 is positive, Test 2 is negative and gold standard is positive.

s01

Number of cases where Test 1 is negative, Test 2 is positive and gold standard is positive.

s00

Number of cases where Test 1 is negative, Test 2 is negative and gold standard is positive.

r11

Number of cases where Test 1 is positive, Test 2 is positive and gold standard is negative.

r10

Number of cases where Test 1 is positive, Test 2 is negative and gold standard is negative.

r01

Number of cases where Test 1 is negative, Test 2 is positive and gold standard is negative.

r00

Number of cases where Test 1 is negative, Test 2 is negative and gold standard is negative.

Value

A data frame populated with zeros and ones indicating positive or negative test results which can be passed to the compareR function.

Details

Understanding the parameter names: s & r represent positive and negative results for the gold standard test, respectively. The first digit represents a positive (1) or negative (0) result for Test 1. The second digit represents a positive (1) or negative (0) result for Test 2.

Examples

# build data frame using numbers
dataframeR(3, 3, 3, 3, 3, 3, 3, 3)
#>    test1 test2 gold
#> 1      1     1    1
#> 2      1     1    1
#> 3      1     1    1
#> 4      1     0    1
#> 5      1     0    1
#> 6      1     0    1
#> 7      0     1    1
#> 8      0     1    1
#> 9      0     1    1
#> 10     0     0    1
#> 11     0     0    1
#> 12     0     0    1
#> 13     1     1    0
#> 14     1     1    0
#> 15     1     1    0
#> 16     1     0    0
#> 17     1     0    0
#> 18     1     0    0
#> 19     0     1    0
#> 20     0     1    0
#> 21     0     1    0
#> 22     0     0    0
#> 23     0     0    0
#> 24     0     0    0