Learn R Programming

UncertainInterval (version 0.7.0)

simple_roc3: Primitive non-parametric function for calculating false and true positive rate for two comparable samples with ordinal data.

Description

Primitive non-parametric function for calculating false and true positive rate for two comparable samples with ordinal data.

Usage

simple_roc3(norm, abnorm)

Arguments

norm

Ordinal data of the norm group (controls).

abnorm

Ordinal data of the abnorm group (patients).

Value

List of

  • $testscores sorted available unique test scores.

  • $dich.thresholds Indicates the thresholds and their interpretation. If mean(norm) > mean(abnorm), the thresholds are <= test score, otherwise the thresholds are >= test score.

  • $d0 Frequencies of ordinal scores of norm group, from lowest to highest score

  • $d1 Frequencies of ordinal scores of abnorm group, from lowest to highest score

  • $TP Cumulative true positive scores. If mean(norm) > mean(abnorm) the highest score is the total sum, otherwise the lowest score is the total sum.

  • $FP Cumulative false positive scores. If mean(norm) > mean(abnorm) the highest score is the total sum, otherwise the lowest score is the total sum.

  • $tpr True positive rates (Sensitivities) for each threshold

  • $fpr False positive rates (1 - Specificities) for each threshold

Details

This function does not check anything. Argument norm and abnorm must have the correct ordinal data. The thresholds only concern available test scores and are always ordered from lowest to highest.

Examples

Run this code
# NOT RUN {
norm = round(rnorm(100, 3, 1))
abnorm= round(rnorm(80, 5, 2))
(res=simple_roc3(norm, abnorm))
# Plot ROC curve
plot(x=res$fpr, y=res$tpr, type='l')
abline(a=c(0,0), b=c(1,1))
# }

Run the code above in your browser using DataLab