View source: R/analyticScreening.R
analyticScreening | R Documentation |
Analytic calculation of screening sensitivity, specificity, positive and negative predictive value, concordance and relative utility, under a multivariate liability threshold model.
analyticScreening(VL, VX, VLX = NULL, thresh = NULL, prev, nsample = NULL)
VL |
Variance-covariance matrix of liability. Must have 1 on diagonal. |
VX |
Variance-covariance matrix of predictors. |
VLX |
Cross-covariance matrix between liabilities and predictors. Entry on row i, column j, is covariance between liability i and predictor j. Diagonal entries are the liability variances explained for each trait. |
thresh |
Vector of risk thresholds for predicting an event. If NULL, which is the default, concordance is the only measure that can be calculated. |
prev |
Vector of prevalences, ie population risks, for each trait. |
nsample |
Number of random samples drawn when estimating concordance. If NULL, which is the default, concordance is not calculated. |
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 simulating nsample
such pairs of individuals from the specified model.
A list with the following components
sens
Sensitivity
spec
Specificity
PPV
Positive predictive value
NPV
Negative predictive value
C
Concordance
RU
Relative utility
# results will vary due to random sampling in computing multivariate integrals attach(PRSdata) analyticScreening(VL,VX,VX,thresh=prevalence,prev=prevalence,nsample=1e5) # $sens # [1] 0.9591925 # $spec # [1] 0.06055228 # $PPV # [1] 0.1604819 # $NPV # [1] 0.8879618 # $C # [1] 0.59799 # $RU # [1] -0.04479532
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.