Skip to contents

Mass-univariate GLM Analysis

Usage

massGLM(x, y, scale_y = NULL, center_y = NULL, verbosity = 1L)

Arguments

x

data.frame or similar: Predictor variables

y

data.frame or similar: Each column is a different outcome. The function will train one GLM for each column of y.

scale_y

Logical: If TRUE, scale each column of y to have mean 0 and sd 1. If NULL, defaults to TRUE if y is numeric, FALSE otherwise.

center_y

Logical: If TRUE, center each column of y to have mean 0. If NULL, defaults to TRUE if scale_y is TRUE, FALSE otherwise.

verbosity

Integer: Verbosity level.

Value

MassGLM object.

Author

EDG

Examples

if (FALSE) { # \dontrun{
# x: outcome of interest as first column, optional covariates in the other columns
# y: features whose association with x we want to study
set.seed(2022)
y <- data.table(rnormmat(500, 40))
x <- data.table(
  x1 = y[[3]] - y[[5]] + y[[14]] + rnorm(500),
  x2 = y[[21]] + rnorm(500)
)
massmod <- massGLM(x, y)
plot(massmod)
} # }