score.fixed: Score Test for Covariates with Fixed Effects in Linear or...

score.fixed.linear/score.fixed.logisticR Documentation

Score Test for Covariates with Fixed Effects in Linear or Logistic Mixed Model

Description

Score Test for association between covariates and phenotype.

Usage

 
score.fixed.linear(x, Y, X = matrix(1, length(Y)), K, ...)
score.fixed.logistic(x, Y, X = matrix(1, length(Y)), K, ...)

Arguments

x

A matrix of covariates

Y

The phenotype vector

X

A covariable matrix. The default is a column vector of ones, to include an intercept in the model

K

A positive definite matrix or a list of such matrices

...

Optional arguments used to fit null model in lmm.aireml or logistic.mm.aireml function.

Details

The function score.fixed.linear considers the linear mixed model

Y = X\alpha + x\beta + \omega_1 + \ldots + \omega_k + \varepsilon

whereas the score.fixed.logistic function considers the following logistic model

\mbox{logit}(P[Y=1|X,x,\omega_1,\ldots,\omega_k]) = X\alpha + x\beta + \omega_1 + \ldots + \omega_k

with \omega_j \sim N(0,\tau_j K_j) where K_j are Genetic Relationship Matrix (GRM), \varepsilon \sim N(0,\sigma^2 I_n) and fixed effects \alpha and \beta.

The two functions give score test for H_0 : \beta=0 vs H_1 : \beta\neq 0. In this aim, all parameters under null model are estimated with lmm.aireml or logistic.mm.aireml.

Value

A named list of values:

score

Estimated score

p

The corresponding p-value

log.p

The logarithm of corresponding p-value

Author(s)

Hervé Perdry and Claire Dandine-Roulland

See Also

lmm.aireml, logistic.mm.aireml

Examples

# Load data
data(AGT)
x <- as.bed.matrix(AGT.gen, AGT.fam, AGT.bim)
standardize(x) <- "p"

# Calculate GRM et its eigen decomposition
k <- GRM(x)
eig <- eigen(k)
eig$values <- round(eig$values, 5)

# generate covariate matrix
set.seed(1)
X <- cbind( rbinom(nrow(x), 1, prob=1/2), rnorm(nrow(x)) )


# simulate quantitative phenotype with polygenic component and covariate effects
y <- X %*% c(-1,0.5) + lmm.simu(0.3,1,eigenK=eig)$y

t <- score.fixed.linear(X, y, K=k, verbose=FALSE)
str(t)


# simulate binary phenotype with polygenic component and covariate effects
mu <- X %*% c(-1,0.5) + lmm.simu(1, 0, eigenK=eig)$y
pi <- 1/(1+exp(-mu))
y <- 1*( runif(length(pi))<pi )

tt <- score.fixed.logistic(X, y, K=k, verbose=FALSE)
str(tt)

gaston documentation built on May 29, 2024, 7:33 a.m.