Learn R Programming

gtx (version 0.0.8)

grs.plot: Diagnostic plot for genetic risk score calculation from summary statistics.

Description

Each SNP is plotted by coefficient in the risk score (x axis) versus estimated effect size for trait of interest in the testing dataset (y axis). A solid red line shows the effect size estimate for the risk score on the trait of interest in the testing dataset.

Usage

grs.plot(w, b, s, text = NULL, textpos = NULL, textcex = 0.5, alpha = 0.05)

Arguments

w
coefficients for the risk score.
b
aligned beta coefficients in the testing dataset.
s
standard errors for b.
text
optional labels for SNPs
textpos
position for labels for SNPs, as pos argument to text().
textcex
size for lables for SNPs, as cex argument to text().
alpha
determines size of confidence limits plotted.

Examples

Run this code
data(t2dex)
library(survival)
mycoxph <- coxph(Surv(FollowupDays,FollowupT2D) ~ Overweight,
                 data = t2dex$data) # fit null model
data(t2d.scores)
assoc1 <- grs.onesnp.apply(t2d.scores, mycoxph) # single SNP association
## risk score fit from single SNPs
grs.plot(t2d.scores$coef, assoc1$beta, assoc1$se, t2d.scores$name)
title(xlab = "risk score weight", ylab = "estimated effect size")

Run the code above in your browser using DataLab