glslrApply: Generalized least squares for many tests

Description Usage Arguments Details Examples

Description

Generalized least squares using precomputed eigen decomposition of covariance matrix for many test variables

Usage

1
2
glslrApply(Y, X, U, lambda = rep(1, ncol(U)), rank = ncol(U),
  X_test_lst = NULL, smethod = "low", quantileTransform = FALSE)

Arguments

Y

response variable

X

matrix of covariates, usually just a mean term

U

eigen vectors of covariance matrix

lambda

eigen values of covariance matrix. If not specified, set all values to 1

rank

number of eigen vectors of U to use

X_test_lst

list of matries to be tested one at a time

smethod

placeholder argument

quantileTransform

Use a non-parametric test that only uses the ranks of the transformed test statistics.

Details

Fits glslr() for a large set of covariates one at a time. glslrApply() performs the preprocessing a single time, so a much faster than applying gslr() to each test separately

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(mvtnorm)
library(clusterGeneration)

# number of samples
N = 100

# Generate positive definite covariance matrix 
C = genPositiveDefMat(N)$Sigma

# simulate response from covariance matrix C
y = t(rmvnorm(1, rep(0, N), C))

# eigen decomposition of matrix C
dcmp = eigen(C)
U = dcmp$vectors
lambda = dcmp$values

# Intercept term
X = rep(1,N)

# simulate 2 random covariates to test one at a time
X_test_lst = list(rnorm(N), rnorm(N))

# same result using faster glslrApply() for many tests
glslrApply(y, X, U, lambda, X_test_lst=X_test_lst)

GabrielHoffman/pinnacle documentation built on May 3, 2019, 3:02 p.m.