Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

score.fixed

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 + ... + omega_k + varepsilon

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

logit(P[Y=1|X,x,omega_1,...,omega_k]) = Xalpha + x beta + omega_1 + ... + omega_k

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

The two functions give score test for H0 : beta=0 vs H1 : beta !=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

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

Genetic Data Handling (QC, GRM, LD, PCA) & Linear Mixed Models

v1.5.7
GPL-3
Authors
Hervé Perdry [cre, aut, cph], Claire Dandine-Roulland [aut, cph], Deepak Bandyopadhyay [cph] (C++ gzstream class), Lutz Kettner [cph] (C++ gzstream class)
Initial release
2020-09-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.