Skip to contents

lmrse fits a linear regression model with cluster robust standard errors for all markers.

Usage

lmrse(formula, cluster, data = NULL)

Arguments

formula

containing the marker matrix as the response and the exposure and covariates as the dependent terms

cluster

clustering variable

data

an optional data.frame which contains the covariates specified in the formula

Value

lmrse returns a list of coefficients, standard errors and p-values matrices:

coef

a matrix of regression coefficients

se

a matrix of standard errors

p

a matrix of p-values

Author

James Staley jrstaley95@gmail.com

Examples

# Data
y <- rnorm(5000000)
y <- matrix(y, ncol = 1000)
colnames(y) <- paste0("var", 1:1000)
x <- rnorm(5000)
cluster <- rep(1:1000, 5)
c1 <- rbinom(5000, 1, 0.5)
c2 <- rnorm(5000)

# Analyses
res <- lmrse(y ~ x + c1 + c2, cluster = cluster)