ICsingleSNP {ICSKAT}R Documentation

ICsingleSNP.R

Description

Burden test from ICSKAT() except do a separate burden test for each SNP in gMat, one at a time.

Usage

ICsingleSNP(
  left_dmat,
  right_dmat,
  lt,
  rt,
  obs_ind,
  tpos_ind,
  gMat,
  null_beta,
  solveItt,
  p
)

Arguments

left_dmat

n*(p+nknots+2) design matrix for left end of interval.

right_dmat

n*(p+nknots+2) design matrix for right end of interval.

lt

n*1 vector of left side of time interval.

rt

n*1 vector of right side of time interval.

obs_ind

n*1 vector of whether the event was observed before last follow-up.

tpos_ind

n*1 vector of whether the event was observed after follow-up started (t>0).

gMat

n*q genotype matrix.

null_beta

(p+nknots+2)*1 vector of coefficients for null model.

solveItt

Inverse of (p+nknots+2)*(p+nknots+2) Fisher information matrix for null model coefficients.

p

number of non-SNP covariates.

Value

A list with the elements:

testStatsVec

p*1 vector of score test statistics

pVec

p*1 vector of score test p-values

Examples

set.seed(0)
gMat <- matrix(data=rbinom(n=2000, size=2, prob=0.3), nrow=100)
xMat <- matrix(data=rnorm(200), nrow=100)
bhFunInv <- function(x) {x}
obsTimes <- 1:5
etaVec <- rep(0, 100)
outcomeDat <- gen_IC_data(bhFunInv = bhFunInv, obsTimes = obsTimes, windowHalf = 0.1,
probMiss = 0.1, etaVec = etaVec)
lt <- outcomeDat$leftTimes
rt <- outcomeDat$rightTimes
tpos_ind <- as.numeric(lt > 0)
obs_ind <- as.numeric(rt != Inf)
dmats <- make_IC_dmat(xMat, lt, rt, obs_ind, tpos_ind)
nullFit <- ICSKAT_fit_null(init_beta = rep(0, 5), left_dmat = dmats$left_dmat,
right_dmat=dmats$right_dmat, obs_ind = obs_ind, tpos_ind = tpos_ind, lt = lt, rt = rt)
solveItt  <- solve(nullFit$Itt)
ICsingleSNP(left_dmat = dmats$left_dmat, right_dmat=dmats$right_dmat, lt = lt, rt = rt,
obs_ind = obs_ind, tpos_ind = tpos_ind, gMat = gMat, null_beta = nullFit$beta_fit,
solveItt = solveItt, p=2)


[Package ICSKAT version 0.2.0 Index]