interpretR
interpretR.Rd
Provides a plain English readout of the results of the compareR function.
Examples
# simulate data
test1 <- c(rep(1, 300), rep(0, 100), rep(1, 55), rep(0, 145))
test2 <- c(rep(1, 280), rep(0, 120), rep(1, 45), rep(0, 155))
gold <- c(rep(1, 400), rep(0, 200))
dat <- data.frame(test1, test2, gold)
# compare with compareR
result <- compareR(dat)
# provide a plain English readout with interpretR
interpretR(result)
#>
#> WARNING:
#> Zeros exist in contingency table. Tests may return NA/NaN.
#>
#> --------------------------------------------------------------------------------
#> CONTINGENCY TABLES
#> --------------------------------------------------------------------------------
#>
#> True Status - POSITIVE
#> Test 2
#> Test 1 Positive Negative
#> Positive 280 20
#> Negative 0 100
#>
#> True Status - NEGATIVE
#> Test 2
#> Test 1 Positive Negative
#> Positive 45 10
#> Negative 0 145
#>
#> --------------------------------------------------------------------------------
#> PREVALENCE (%)
#> --------------------------------------------------------------------------------
#>
#> Estimate SE Lower CI Upper CI
#> Prevalence 66.7 1.9 62.8 70.3
#>
#> --------------------------------------------------------------------------------
#> DIAGNOSTIC ACCURACIES
#> --------------------------------------------------------------------------------
#>
#> Test 1 (%)
#> Estimate SE Lower CI Upper CI
#> Sensitivity 75.0 2.2 70.5 79.0
#> Specificity 72.5 3.2 66.0 78.3
#>
#> Test 2 (%)
#> Estimate SE Lower CI Upper CI
#> Sensitivity 70.0 2.3 65.4 74.3
#> Specificity 77.5 3.0 71.3 82.8
#>
#> Global Null Hypothesis: Se1 = Se2 & Sp1 = Sp2
#> Test statistic: 31.57895 Adjusted p value: 4.167158e-07 ***SIGNIFICANT***
#>
#> Investigating cause(s) of significance
#>
#> Null Hypothesis 1: Se1 = Se2
#> Test statistic: 18.05 Adjusted p value: 0.0001506251 ***SIGNIFICANT***
#>
#> Null Hypothesis 2: Sp1 = Sp2
#> Test statistic: 8.1 Adjusted p value: 0.02213263 ***SIGNIFICANT***
#>
#> --------------------------------------------------------------------------------
#> PREDICTIVE VALUES
#> --------------------------------------------------------------------------------
#>
#> Test 1 (%)
#> Estimate SE Lower CI Upper CI
#> PPV 84.5 1.9 80.4 87.9
#> NPV 59.2 3.1 52.9 65.2
#>
#> Test 2 (%)
#> Estimate SE Lower CI Upper CI
#> PPV 86.2 1.9 82.0 89.5
#> NPV 56.4 3.0 50.5 62.1
#>
#> Global Null Hypothesis: PPV1 = PPV2 & NPV1 = NPV2
#> Test statistic: 28.43169 Adjusted p value: 1.340192e-06 ***SIGNIFICANT***
#>
#> Investigating cause(s) of significance
#>
#> Null Hypothesis 1: PPV1 = PPV2
#> Test statistic: 4.059529 Adjusted p value: 0.08784551
#>
#> Null Hypothesis 2: NPV1 = NPV2
#> Test statistic: 6.343355 Adjusted p value: 0.04712873 ***SIGNIFICANT***
#>
#> --------------------------------------------------------------------------------
#> LIKELIHOOD RATIOS
#> --------------------------------------------------------------------------------
#>
#> Test 1 (%)
#> Estimate SE Lower CI Upper CI
#> PLR 2.7 0.3 2.2 3.5
#> NLR 0.3 0.0 0.3 0.4
#>
#> Test 2 (%)
#> Estimate SE Lower CI Upper CI
#> PLR 3.1 0.4 2.4 4.1
#> NLR 0.4 0.0 0.3 0.5
#>
#> Global Null Hypothesis: PLR1 = PLR2 & NLR1 = NLR2
#> Test statistic: 24.2216 Adjusted p value: 5.499788e-06 ***SIGNIFICANT***
#>
#> Investigating cause(s) of significance
#>
#> Null Hypothesis 1: PLR1 = PLR2
#> Test statistic: 2.013107 Adjusted p value: 0.08784551
#>
#> Null Hypothesis 2: NLR1 = NLR2
#> Test statistic: 2.516314 Adjusted p value: 0.04712873 ***SIGNIFICANT***