roc_table | R Documentation |
Calculate the sensibility and the specificity of a psychometric test for candidate cutoffs. and plot a ROC curve.
roc_table(test, gold.std, cutoff = sort(unique(test)))
## S3 method for class 'ROC'
## S3 method for class 'ROC'
plot(x, labels = TRUE, ...)
test |
Numeric vector reporting the score obtained of a test for a group of persons. |
gold.std |
Dichotomous vector reporting the classification performed by another test, considered as gold standard. The first value identifies negative people, the second value positive people. |
cutoff |
Numeric vector containing the thresholds at which to calculate the sensibility and the
specificity of the test. For each threshold, people reporting a test value equal or
greater of the threshold value are considered as positive. As default, all the values
contained into the vector |
x |
An object of class |
labels |
Logical. If true, plot the labels identifying each cutoff value. |
... |
Further arguments for the function |
Davide Massidda <davide.massidda@gmail.com>
x <- c(3,4,4,0,3,1,2,3,2,2,2,2,3,4,5,1,1,4,2,3,4,2,2,1,5,2,3,5,2,5,1,5,4,3,1)
g <- c(0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,1,1,1,1,0,0,0,1,0,0,1,0,1,0,1,1,1,0)
(tab <- roc_table(x, g))
plot(tab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.