Learn R Programming

RNOmni (version 1.0.0)

BAT: Basic Association Test

Description

Conducts tests of association between the loci in G and the untransformed phenotype y, adjusting for the model matrix X.

Usage

BAT(y, G, X = NULL, test = "Score", simple = FALSE)

Value

If simple = TRUE, returns a vector of p-values, one for each column of G. If simple = FALSE, returns a numeric matrix, including the Wald or Score statistic, its standard error, the Z-score, and the p-value.

Arguments

y

Numeric phenotype vector.

G

Genotype matrix with observations as rows, SNPs as columns.

X

Model matrix of covariates and structure adjustments. Should include an intercept. Omit to perform marginal tests of association.

test

Either Score or Wald.

simple

Return the p-values only?

See Also

  • Direct INT DINT

  • Indirect INT IINT

  • Omnibus INT OINT

Examples

Run this code
set.seed(100)
# Design matrix
X <- cbind(1, rnorm(1e3))
# Genotypes
G <- replicate(1e3, rbinom(n = 1e3, size = 2, prob = 0.25))
storage.mode(G) <- "numeric"
# Phenotype
y <- as.numeric(X %*% c(1, 1)) + rnorm(1e3)
# Association test
p <- BAT(y = y, G = G, X = X)

Run the code above in your browser using DataLab