grs.onesnp.apply: Convenience tool to fit a series of single-SNP models.

Description Usage Arguments Details Author(s) Examples

Description

This function takes as input a fitted model object, typically created by the standard R functions lm, glm or coxph, and fitted to individual-level genotype and phenotype data. The model is augmented by adding a term for each single SNP in turn and the refitted. This provides the single SNP summary association statistics needed to apply the summry statistic methods.

Usage

1
grs.onesnp.apply(params, object, coeff.extract.fun = coeff.extract)

Arguments

params

a data frame, see gtx.params.

object

a fitted model object of class lm, glm, or coxph

coeff.extract.fun

function that extracts Estimate and Std.Err from fitted model objects, see coeff.extract.

Details

By default this uses coeff.extract to detect the class of object and handles coefficient extraction appropriately. Supply your own function if you have an object that works with update (supply your own update too).

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(survival)
data(t2d.scores)
data(t2dex)

mycoxph <- coxph(Surv(FollowupDays,FollowupT2D) ~ Overweight,
                 data = t2dex$data) # fit null model
assoc1 <- grs.onesnp.apply(t2d.scores, mycoxph) # single SNP association
## risk score fit from single SNPs
unlist(grs.summary(t2d.scores$coef, assoc1$beta, assoc1$se,
                   n = length(residuals(mycoxph))))

## compare direct analysis of subject-specific data
t2dex <- grs.make.scores(t2d.scores, t2dex)
coxph(Surv(FollowupDays,FollowupT2D) ~ Overweight + T2D2010.score,
      data = t2dex$data)

gtx documentation built on May 2, 2019, 5:08 a.m.