plotAccuracy: Plot predictive accuracy

Description Usage Arguments Details Value Author(s) References Examples

View source: R/plotAccuracy.R

Description

Plots the AUC or the R2 as a function of training sample size.

Usage

1
2
3
4
5
plotAccuracy(xlim = c(1, 500), ylim = 0, nsnp = 1e+05, vg1 = 0,
  pi0 = 0, cov12 = NA, fix = TRUE, binary = FALSE, prevalence = 0,
  sampling = 0.5, r2gx = 0, corgx = 0, r2xy = 0,
  adjustedEffects = FALSE, plot = TRUE, col = "black", breakeven = 0.5,
  lty = 1)

Arguments

xlim

Vector of 2 elements, giving the range of sample size to display on the x-axis, in 1000s. For binary traits this is the number of cases.

ylim

Range of AUC/R2 to display on y-axis.

nsnp

Number of independent SNPs in the gene score.

vg1

Proportion of variance explained by genetic effects in the training sample.

pi0

Proportion of markers with no effect on the training trait.

cov12

Covariance between genetic effect sizes in the two samples. If the effects are fully correlated then cov12<=sqrt(vg1). If the effects are identical then cov12=vg1 (default).

fix

TRUE if the same genetic model is assumed for the training and target samples.

binary

TRUE if the training trait is binary. By default, the target trait is binary if the training trait is; otherwise binary should be a vector with two elements for the training and target samples respectively.

prevalence

For a binary trait, prevalence in the training sample. By default, prevalence is the same in the target sample. Otherwise, prevalence should be a vector with two elements for the training and target samples respectively.

sampling

For a binary trait, case/control sampling fraction in the training sample. By default, sampling equals the prevalence, as in a cohort study. If the sampling fraction is different in the target sample, sampling should be a vector with two elements for the training and target samples respectively.

r2gx

Proportion of variance in environmental risk score explained by genetic effects in training sample.

corgx

Genetic correlation between environmental risk score and training trait.

r2xy

Proportion of variance in training trait explained by environmental risk score.

adjustedEffects

TRUE if polygenic and envrionmental scores are combined as a weighted sum. If FALSE, the scores are combined as an unweighted sum even if they are correlated.

plot

TRUE is a new plot is to be drawn, otherwise draw lines on the existing plot.

col

Colour in which to plot.

breakeven

Value of AUC/R2 for which the minimum sample size will be estimated.

lty

Line type parameter for R plots.

Details

AUC is plotted for binary traits, R2 for quantitative traits. At each point, the p-value threshold is identified for selecting markers into the polygenic score, such that the AUC or R2 is maximised.

Value

A list with the following elements:

Author(s)

Frank Dudbridge

References

Dudbridge F (2013) Power and predictive accuracy of polygenic risk scores. PLoS Genet 9:e1003348

Examples

1
2
# Breast cancer with 90% null markers, from figure 3 in Dudbridge (2013)
plotAccuracy(vg1=0.44/2,pi0=0.90,fix=TRUE,binary=TRUE,prevalence=0.036)

DudbridgeLab/AVENGEME documentation built on Oct. 17, 2019, 6:57 a.m.