greyzone: Function for the determination of a grey zone for ordinal...

Description Usage Arguments Details Value References See Also Examples

View source: R/greyzone.R

Description

Function for the determination of a grey zone for ordinal diagnostic and screening tests

Usage

1
2
3
4
5
6
7
8
greyzone(
  ref,
  test,
  pretest.prob = NULL,
  criterion.values = c(0.05, 0.95),
  return.all = F,
  precision = 3
)

Arguments

ref

The reference standard. A column in a data frame or a vector indicating the reference or gold standard. The reference standard must be coded either as 0 (absence of the condition) or 1 (presence of the condition).

test

The numeric test scores under evaluation. When mean(test[ref == 0]) > mean(test[ref == 1]) it is assumed that higher test scores indicate presence of the condition, otherwise that lower test scores indicate presence of the condition.

pretest.prob

The pre-test probability to be used. When NULL, the prevalence found in the sample is used.

criterion.values

The minimum desired values for respectively the negative and positive post-test probability.

return.all

Default = FALSE. When TRUE the full table of all results are returned.

precision

Default = 3. Precision used for comparison of the criterion values and the post-test probabilities.

Details

This function is proposed by Coste et al. (2003). The current implementation only handles ordinal test values. This functions uses all possible test scores as dichotomous thresholds to calculate Se, Sp, positive and negative likelihood ratios and post-test probabilities. The likelihood ratios are calculated for the accumulated densities of the test scores and indicate the levels of seriousness of the disease for all possible dichotomous thresholds. It uses therefore a cumulative interpretation of the Likelihood Ratios and posttest probabilities. If a test has test scores 1 to 5 (with 5 indicating the largest probability of the disease), Se, positive LR and positive posttest probabilities of the greyzone function uses dichotomous thresholds that concern test results >= 1, >= 2, >= 3, >= 4 and >= 5, while Sp, negative LR and negative posttest probabilities concern test results <= 1, <= 2, <= 3, <= 4 and <= 5. Please note that in these examples values <= 1 respectively <= 5 concern all possible test values and have by definition a dichotomous Sensitivity of 1.

Please note that the definition of a grey zone deviates from the definition of an uncertain interval.

The decision criteria are the required values of post-test probabilities. This has changed in version 0.7. In earlier versions the criteria was a value closest to the criterion, which could produce invalid results. These post-test probabilities of accumulated test scores may require a value over 0.99 or even 0.999 (or under 0.01 or 0.001) to confirm or exclude the presence of a target disease. Only tests of the highest quality can reach such criteria. The default criterion values are .05 and .95 for respectively a negative and positive classification, which may be sufficient for use by clinicians or Public Health professionals for a first classification whether a target disease may be present or not (Coste et al., 2003).

As such the cumulative likelihood ratios differ from the Interval Likelihood Ratios (see RPV), as proposed by Sonis (1999). These likelihood ratios are calculated for each given interval of test scores separately and uses their densities. In contrast to the greyzone method, Interval Likelihood ratios and interval posttest probabilities concern the separate intervals, that is in this example, the separate score 1 to 5. Interval likelihood ratios assign a specific value to each level of abnormality, and this value is used to calculate the posttest probabilities of disease for each given level of a test (Sonis, 1999). These post-test probabilities differ strongly from the cumulative post-test probabilities and criterion values can be much lower, especially when diseases are life threatening and low-cost treatments are available. See Sonis (1999) for further discussion of the interval interpretation.

Value

The function returns the lower and upper value of the range of test scores that are considered 'grey' or inconclusive. Only smaller or larger values are considered for a decision. When return.all = TRUE the full table of the results is returned.

References

Coste, J., Jourdain, P., & Pouchot, J. (2006). A gray zone assigned to inconclusive results of quantitative diagnostic tests: application to the use of brain natriuretic peptide for diagnosis of heart failure in acute dyspneic patients. Clinical Chemistry, 52(12), 2229-2235.

Coste, J., & Pouchot, J. (2003). A grey zone for quantitative diagnostic and screening tests. International Journal of Epidemiology, 32(2), 304-313.

Sonis, J. (1999). How to use and interpret interval likelihood ratios. Family Medicine, 31, 432-437.

See Also

RPV

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ref=c(rep(0, 250), rep(1, 250))
 test = c(rep(1:5, c(90,75,50,34,1)), c(rep(1:5, c(10,25,50,65,100))))
 addmargins(table(ref, test))
 greyzone(ref, test, ret=TRUE, criterion.values=c(.1, .9))

 test = c(rep(14:31, c(0,0,0,0,0,0,3,3,5,7,10,20,30,40,50,24,10,10)),
          rep(14:31, c(1,0,0,0,0,0,1,4,4,9, 6,13, 8, 6, 5, 4, 0, 0)))
 ref = c(rep(0, 212), rep(1, 61))
 barplotMD(ref, test)
 addmargins(table(ref, test))
 greyzone(ref, test, ret=TRUE, crit=c(.1,.9))

Example output

     test
ref     1   2   3   4   5 Sum
  0    90  75  50  34   1 250
  1    10  25  50  65 100 250
  Sum 100 100 100  99 101 500
$table
  thresholds d0  d1 tot  TP  FP  TN  FN  tpr   fpr preodds    sp   se    neg.lr
1          1 90  10 100 250 250   0   0 1.00 1.000       1 0.000 1.00       NaN
2          2 75  25 100 240 160  90  10 0.96 0.640       1 0.360 0.96 0.1111111
3          3 50  50 100 215  85 165  35 0.86 0.340       1 0.660 0.86 0.2121212
4          4 34  65  99 165  35 215  85 0.66 0.140       1 0.860 0.66 0.3953488
5          5  1 100 101 100   1 249 150 0.40 0.004       1 0.996 0.40 0.6024096
      pos.lr negpostodds pospostodds negpostprob pospostprob
1   1.000000         NaN    1.000000         NaN   0.5000000
2   1.500000   0.1111111    1.500000   0.1000000   0.6000000
3   2.529412   0.2121212    2.529412   0.1750000   0.7166667
4   4.714286   0.3953488    4.714286   0.2833333   0.8250000
5 100.000000   0.6024096  100.000000   0.3759398   0.9900990

$thresholds
lt ut 
 2  4 

     test
ref    14  20  21  22  23  24  25  26  27  28  29  30  31 Sum
  0     0   3   3   5   7  10  20  30  40  50  24  10  10 212
  1     1   1   4   4   9   6  13   8   6   5   4   0   0  61
  Sum   1   4   7   9  16  16  33  38  46  55  28  10  10 273
$table
   thresholds d0 d1 tot TP  FP  TN FN        tpr        fpr   preodds
1          14  0  1   1 61 212   0  0 1.00000000 1.00000000 0.2877358
2          20  3  1   4 60 212   0  1 0.98360656 1.00000000 0.2877358
3          21  3  4   7 59 209   3  2 0.96721311 0.98584906 0.2877358
4          22  5  4   9 55 206   6  6 0.90163934 0.97169811 0.2877358
5          23  7  9  16 51 201  11 10 0.83606557 0.94811321 0.2877358
6          24 10  6  16 42 194  18 19 0.68852459 0.91509434 0.2877358
7          25 20 13  33 36 184  28 25 0.59016393 0.86792453 0.2877358
8          26 30  8  38 23 164  48 38 0.37704918 0.77358491 0.2877358
9          27 40  6  46 15 134  78 46 0.24590164 0.63207547 0.2877358
10         28 50  5  55  9  94 118 52 0.14754098 0.44339623 0.2877358
11         29 24  4  28  4  44 168 57 0.06557377 0.20754717 0.2877358
12         30 10  0  10  0  20 192 61 0.00000000 0.09433962 0.2877358
13         31 10  0  10  0  10 202 61 0.00000000 0.04716981 0.2877358
           sp         se   neg.lr    pos.lr negpostodds pospostodds negpostprob
1  0.00000000 1.00000000      NaN 1.0000000         NaN  0.28773585         NaN
2  0.00000000 0.98360656      Inf 0.9836066         Inf  0.28301887         NaN
3  0.01415094 0.96721311 2.316940 0.9810966   0.6666667  0.28229665   0.4000000
4  0.02830189 0.90163934 3.475410 0.9279007   1.0000000  0.26699029   0.5000000
5  0.05188679 0.83606557 3.159463 0.8818204   0.9090909  0.25373134   0.4761905
6  0.08490566 0.68852459 3.668488 0.7524083   1.0555556  0.21649485   0.5135135
7  0.13207547 0.59016393 3.103044 0.6799715   0.8928571  0.19565217   0.4716981
8  0.22641509 0.37704918 2.751366 0.4874050   0.7916667  0.14024390   0.4418605
9  0.36792453 0.24590164 2.049601 0.3890384   0.5897436  0.11194030   0.3709677
10 0.55660377 0.14754098 1.531537 0.3327520   0.4406780  0.09574468   0.3058824
11 0.79245283 0.06557377 1.179157 0.3159463   0.3392857  0.09090909   0.2533333
12 0.90566038 0.00000000 1.104167 0.0000000   0.3177083  0.00000000   0.2411067
13 0.95283019 0.00000000 1.049505 0.0000000   0.3019802  0.00000000   0.2319392
   pospostprob
1   0.22344322
2   0.22058824
3   0.22014925
4   0.21072797
5   0.20238095
6   0.17796610
7   0.16363636
8   0.12299465
9   0.10067114
10  0.08737864
11  0.08333333
12  0.00000000
13  0.00000000

$thresholds
lt ut 
31 14 

UncertainInterval documentation built on March 3, 2021, 1:10 a.m.