MSKAT {MSKAT} | R Documentation |
Compute the rare variant set association test statistics and p-values
MSKAT(obj, G, W = NULL, W.beta = c(1, 25))
obj |
fitted null model from MSKAT.cnull |
G |
genotype matrix with SNPs in column |
W |
variant weight; use Beta dist weight if NULL |
W.beta |
Beta distribution parameters for the variant weight |
a p-value vector p.value with two components (see Wu and Pankow, 2016)
p-value for the kernel statistic Q (sum of chi-square statstics across variants)
p-value for the kernel statistic Q' (sum of SKAT statistics across traits)
Wu,B. and Pankow,J.S. (2016) Sequence kernel association test of multiple continuous phenotypes. Genetic Epidemiology, 40(2), 91-100.
library(CompQuadForm) n=2e3; K=4; p = 2; m = 50 X = matrix(rnorm(n*p), n,p); Z = rbinom(n,1,0.5); XZ = cbind(X,Z) ## simulate genotype from MVN rho = 0.25; maf1 = 0.005; maf2 = 0.015 q1 = qnorm(maf1); q2 = qnorm(maf2) ## pairwise LD R^2 calc with MVN: 0.023^2 and 0.042^2 (very low) ## library(mvtnorm) ## sig = matrix(rho,2,2); diag(sig) = 1 ## (pmvnorm(upper=c(q1,q1),sigma=sig)-maf1^2)/maf1/(1-maf1) ## (pmvnorm(upper=c(q2,q2),sigma=sig)-maf2^2)/maf2/(1-maf2) ## sim qz = q1 + Z*(q2-q1) G1 = matrix(rnorm(n*m), n,m)*sqrt(1-rho) + rnorm(n)*sqrt(rho) G2 = matrix(rnorm(n*m), n,m)*sqrt(1-rho) + rnorm(n)*sqrt(rho) G = 1*(G1<qz) + 1*(G2<qz) yrho = 0.25 Y = matrix(rnorm(n*K), n,K)*sqrt(1-yrho) + rnorm(n)*sqrt(yrho) Y[,1] = Y[,1] + rowSums(X) + Z - rowSums(G[,1:3])*0.5 + G[,m]*0.7 Y[,2] = Y[,2] + rowSums(X) + Z + rowSums(G[,c(1,4,5)])*0.5 - G[,m-1]*0.6 MSKAT(MSKAT.cnull(Y,XZ), G, W.beta=c(1,25)) gamut(Y,G,XZ)