epsAC.test: Score test EPS-AC

Description Usage Arguments Details Value Examples

Description

epsAC.test performs a score test for common genetic variants under the EPS all-case design

Usage

1
epsAC.test(nullmodel, xg, confounder)

Arguments

nullmodel

an object of class formula, that describes the linear regression model under the null hypothesis, see details

xg

a matrix of variables to be tested against the null (NA for not genotyped individuals)

confounder

confounding (non-genetic) covariates

Details

The nullmodel formula object is of the type y~xe, which describes a regression model, y=a+be*xe+e assuming a normal distribution for the residuals (e). The covariate xe is a non-genetic/environmental covariate (optional). The variables are taken from the environment that the function is called from. The null hypothesis bg=0 is tested for the model y=a+be*xe+bg*xg+e. The covariate xg is one or more, genetic markers where missing values are coded as NA. Missing-mechanism must be MCAR or MAR. If xg is a matrix, each variant (column) is tested against the null model.

Confounders are discrete covariates (xe) and the distribution of xg is modelled for each level of unique value of xe.

Value

epsAC.test returns

statistic

the score test statistic

p.value

the P-value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
N = 1000
# Generate environmental covariates
xe1 = rbinom(N,1,0.5); xe2 = rnorm(N,2,1)
# Generate genetic covariates (common variants)
cv1 = rbinom(N,2,0.2); cv2 = rbinom(N,2,0.2)
# Generate phenotype
y = rnorm(N, mean = 1 + 2*xe1 + 3*xe2 + 0.5*cv1 + 0.1*cv2,2)
# Define extremes
u = quantile(y,probs = 3/4,na.rm=TRUE); l = quantile(y,probs = 1/4,na.rm=TRUE)
extreme = (y < l) | (y >= u)
cv1[!extreme] = NA; cv2[!extreme] = NA;

# All case data set
xe_AC = cbind(xe1, xe2)
xg_AC = cbind(cv1, cv2)
y_AC = y
epsAC.test(y_AC ~ xe_AC,xg = xg_AC)
epsAC.test(y_AC ~ xe1 + xe2,xg = xg_AC, confounder = xe1)

theabjorn/extremesampling documentation built on May 31, 2019, 9:10 a.m.