Description Usage Arguments Details Value Examples
epsAC.test
performs a score test for common genetic variants
under the EPS all-case design
1 | epsAC.test(nullmodel, xg, confounder)
|
nullmodel |
an object of class |
xg |
a matrix of variables to be tested against the null (NA for not genotyped individuals) |
confounder |
confounding (non-genetic) covariates |
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.
epsAC.test
returns
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;
# 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.