analyticOutcomeWise: Analytic outcome-wise measures of predictive accuracy

View source: R/analyticOutcomeWise.R

analyticOutcomeWiseR Documentation

Analytic outcome-wise measures of predictive accuracy

Description

Analytic calculation of outcome-wise sensitivity, specificity, positive and negative predictive value, concordance and relative utility, under a multivariate liability threshold model.

Usage

analyticOutcomeWise(VL, VX, VLX = NULL, thresh = NULL, weight = NULL, prev)

Arguments

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.

Details

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.

Value

A list with the following components

sens Sensitivity

spec Specificity

PPV Positive predictive value

NPV Negative predictive value

C Concordance

RU Relative utility

Examples

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


DudbridgeLab/multipred documentation built on Sept. 30, 2022, 2:24 a.m.