View source: R/analyticOutcomeWise.R
analyticOutcomeWise | R Documentation |
Analytic calculation of outcome-wise sensitivity, specificity, positive and negative predictive value, concordance and relative utility, under a multivariate liability threshold model.
analyticOutcomeWise(VL, VX, VLX = NULL, thresh = NULL, weight = NULL, prev)
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. |
weight |
Vector of weights. |
prev |
Vector of prevalences, ie population risks, for each trait. |
Outcome-wise measures consider the prediction of individual outcomes summed over individuals.
When weight
is a vector of 1's (default), outcome-wise measures correspond to classical univariate measures with the x
matrix vectorised into a column vector.
More generally, weight
allows different outcomes to contribute more or less to the calculations.
Outcome-wise sensitivity, specificity and concordance are weighted sums of the univariate measures,
where the weights depend on prev
.
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) analyticOutcomeWise(VL,VX,VX,thresh=prevalence,prev=prevalence) # $sens # [1] 0.6243863 # $spec # [1] 0.6132883 # $PPV # [1] 0.04641913 # $NPV # [1] 0.9818697 # $C # [1] 0.6533142 # $RU # [1] 0.2376747
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.