Description Usage Arguments Details Value Examples
epsCC.test
performs a score test for common genetic variants
under the EPS complete-case design
1 | epsCC.test(nullmodel, xg, l, u)
|
nullmodel |
an object of class |
xg |
a matrix of genetic variants to be tested against the null |
l |
cutoff for lower extreme, can be sample-specific or general |
u |
cutoff for upper extreme, can be sample-specific or general |
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.
Variables are only available
for individuals with high and low values of the phenotype y
;
(y < l
or y > u
), and potentialy some randomly sampled
individuals. The cut-offs l
and u
that specify the
sampling must be given in the cutoffs
argument.
epsCC.test
returns for each genetic variant:
statistic |
the score test statistic |
p.value |
the P-value |
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;
# Complete case data set
xe_CC = cbind(xe1[extreme], xe2[extreme])
xg_CC = cbind(cv1[extreme], cv2[extreme])
y_CC = y[extreme]
epsCC.test(y_CC ~ xe_CC,xg = xg_CC,l,u)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.