Read in “tab.paired”-Objects
read.tab.paired.Rd
Reads in objects of class tab.paired using cell frequencies.
Arguments
- d.a
The number of diseased subjects with a positive test 1 and a positive test 2.
- d.b
The number of diseased subjects with a negative test 1 and a positive test 2.
- d.c
The number of diseased subjects with a positive test 1 and a negative test 2.
- d.d
The number of diseased subjects with a negative test 1 and a negative test 2.
- nd.a
The number of non-diseased subjects with a positive test 1 and a positive test 2.
- nd.b
The number of non-diseased subjects with a negative test 1 and a positive test 2.
- nd.c
The number of non-diseased subjects with a positive test 1 and a negative test 2.
- nd.d
The number of non-diseased subjects with a negative test 1 and a negative test 2.
- 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
containing:
- diseased
A contingency table (matrix) of test results among diseased subjects.
Test1 pos. Test1 neg. Total Test 2 pos. d.a
d.b
d.a
+d.b
Test 2 neg. d.c
d.d
d.c
+d.d
Total d.a
+d.c
d.b
+d.d
d.a
+d.b
+d.c
+d.d
- non.diseased
A contingency table (matrix) of test results among non-diseased subjects.
Test1 pos. Test1 neg. Total Test 2 pos. nd.a
nd.b
nd.a
+nd.b
Test 2 neg. nd.c
nd.d
nd.c
+nd.d
Total nd.a
+nd.c
nd.b
+nd.d
nd.a
+nd.b
+nd.c
+nd.d
- testnames
The names of the diagnostic tests.
Note
Objects of class tab.paired
are essential arguments for various functions in the
DTComPair
-package.
Examples
read.t2 <- read.tab.paired(321, 51, 730, 272,
120, 8, 74, 109,
testnames=c("Test A", "Test B"))
class(read.t2)
#> [1] "tab.paired"
read.t2
#> Two binary diagnostic tests (paired design)
#>
#> Test1: 'Test A'
#> Test2: 'Test B'
#>
#> Diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 321 51 372
#> Test2 neg. 730 272 1002
#> Total 1051 323 1374
#>
#> Non-diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 120 8 128
#> Test2 neg. 74 109 183
#> Total 194 117 311
#>
acc.paired(read.t2)
#> Diagnostic accuracy of test 'Test A'
#>
#> (Estimates, standard errors and 95%-confidence intervals)
#>
#> Est. SE Lower CL Upper CL
#> Sensitivity 0.7649199 0.01143991 0.7424981 0.7873417
#> Specificity 0.3762058 0.02746966 0.3223663 0.4300453
#> PPV 0.8441767 0.01027894 0.8240304 0.8643231
#> NPV 0.2659091 0.02106276 0.2246268 0.3071913
#>
#> Est. SE (log) Lower CL Upper CL
#> PDLR 1.2262376 0.04650675 1.1194070 1.343264
#> NDLR 0.6248709 0.08774821 0.5261371 0.742133
#>
#> ----------------------------------------------------------
#> Diagnostic accuracy of test 'Test B'
#>
#> (Estimates, standard errors and 95%-confidence intervals)
#>
#> Est. SE Lower CL Upper CL
#> Sensitivity 0.2707424 0.01198741 0.2472475 0.2942372
#> Specificity 0.5884244 0.02790551 0.5337306 0.6431182
#> PPV 0.7440000 0.01951738 0.7057466 0.7822534
#> NPV 0.1544304 0.01049740 0.1338558 0.1750049
#>
#> Est. SE (log) Lower CL Upper CL
#> PDLR 0.6578193 0.08097800 0.561278 0.770966
#> NDLR 1.2393395 0.05019212 1.123225 1.367458