Learn R Programming

gtx (version 0.0.8)

t2dex: Simulated example genotype and longitudinal phenotype data.

Description

A simulated example genotype and phenotype dataset for genetic risk score analyses, consisting of genotypes for 2000 individuals at 31 SNPs, baseline case/control and covariate status, and a survival phenotype.

Usage

data(t2dex)

Arguments

Format

t2dex is a list suitable for use with other functions in this package, see snpdata.

Source

The genotypes were simulated using allele frequencies from t2d.scores.

Details

This is a simulated dataset, whose sole purpose is to illustrate the use of functions in this package for genetic risk score analyses. The dataset is provided so that the usage examples can actually be run, without burdening each example with many lines of code to generate an analysable dataset. The genotype data were simulated assuming exact Hardy-Weinberg and linkage equilibrium. The phenotypes were simulated using a crude parametric model of a longitudinal study, intended to be used in regression models as if:
  • t2dex$data$Age is age at recruitment into the study.
  • t2dex$data$Overweight 0/1 indicator for BMI>25 at recruitment.
  • t2dex$data$T2D 0/1 indicator for prevalent T2D at recruitment.
  • t2dex$data$FollowupDays days subject followed up for, until incident T2D event or followup stopped.
  • t2dex$data$FollowupT2D 0/1 indicator for incident T2D event.

Examples

Run this code
data(t2dex)
summary(subset(t2dex$data, select = c("Age", "Overweight", "T2D",
                                      "FollowupDays", "FollowupT2D")))

library(survival)
plot(survfit(Surv(FollowupDays,FollowupT2D) ~ Overweight,
                 data = t2dex$data), col = c("green", "red"))

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
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)

Run the code above in your browser using DataLab