screening | R Documentation |
Calculates screening sensitivity, specificity, positive and negative predictive value, concordance and relative utility for a vector of predictors.
screening(x, y, thresh = NULL, prev = NULL, condprev = NULL, nsample = NULL)
x |
Matrix of predicted risks. Each row corresponds to an individual, each column to an outcome. Each entry should be a risk between 0 and 1. |
y |
Matrix of outcomes. Each row corresponds to an individual, each column to an outcome. Must contain binary outcomes coded as 0 and 1. |
thresh |
Vector of risk thresholds. For each row of x, each outcome is predicted to occur for which the risk exceeds the corresponding element of thresh. These predictions are then compared to the elements of y. If NULL, which is the default, concordance is the only measure that can be calculated. |
prev |
Probability of at least one event, required for calculating relative utility.
If NULL, which is the default, then |
condprev |
Probability of at least one events, conditional on the risk predictions being equal to |
nsample |
Number of random pairs of samples drawn when estimating concordance. If NULL, which is the default, concordance is not calculated. If 0, all possible pairs are drawn from the data. |
Screening measures consider the prediction of at least one outcome to occur, without regard to whether the correct outcomes are predicted. For example, screening sensitivity is the probability that, for an individual in which at least one outcome did occur, the predicted risk exceeds the threshold for at least one outcome (but not necessary the ones that did occur). Screening specificity is the probability that, for an individual in which no outcomes did occur, the predicted risk is lower than the threshold for all outcomes.
Screening concordance is the probability that given one individual in which at least one outcome did occur, and another in which no outcomes did occur,
the maximum predicted risk over all outcomes is higher in the former individual.
It is calculated by randomly drawing such pairs of individuals from y
. If nsample
is zero, all such pairs are drawn from y
;
this might be time-consuming. Therefore the default is not to calculate concordance.
However, a good estimate can be obtained from a limited number of random samples nsample
.
prev
and condprev
are only required to calculate relative utility, and can be omitted otherwise.
A list with the following components
sens
Sensitivity
spec
Specificity
PPV
Positive predictive value
NPV
Negative predictive value
C
Concordance
RU
Relative utility
attach(PRSdata) screening(risk,disease,thresh=prevalence,nsample=1e5) # $sens # [1] 0.9653894 # $spec # [1] 0.05989024 # $PPV # [1] 0.1654311 # $NPV # [1] 0.8996416 # $C # [1] 0.59156 # $RU # [1] -0.009099365
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.