massGLM: Mass-univariate GLM Analysis

View source: R/massGLM.R

massGLMR Documentation

Mass-univariate GLM Analysis

Description

Run a mass-univariate analysis with either: a) single outome (y) and multiple predictors (x), one at a time, with an optional common set of covariates in each model - "massx" b) multiple different outcomes (y) with a fixed set of predictors (x) - "massy" Therefore, the term mass-univariate refers to looking at one variable of interest (with potential covariates of no interest) at a time

Usage

massGLM(
  x,
  y,
  scale.x = FALSE,
  scale.y = FALSE,
  type = NULL,
  xnames = NULL,
  ynames = NULL,
  coerce.y.numeric = FALSE,
  save.mods = FALSE,
  print.plot = FALSE,
  include_anova_pvals = NA,
  verbose = TRUE,
  trace = 0
)

Arguments

x

Matrix / data frame of features

y

Matrix / data frame of outcomes

scale.x

Logical: If TRUE, scale and center x

scale.y

Logical: If TRUE, scale and center y

type

Character: "massx" or "massy". Default = NULL, where if (NCOL(x) > NCOL(y)) "massx" else "massy"

xnames

Character vector: names of x feature(s)

ynames

Character vector: names of y feature(s)

coerce.y.numeric

Logical: If TRUE, coerce y to numeric

save.mods

Logical: If TRUE, save models.

print.plot

Logical: If TRUE, print plot.

include_anova_pvals

Logical: If TRUE, include ANOVA p-values, (generated by glm2table)

verbose

Logical: If TRUE, print messages during run

trace

Integer: If > 0, print more verbose output to console.

Author(s)

E.D. Gennatas

Examples

## Not run: 
# Common usage is "reversed":
# 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)
features <- rnormmat(500, 40)
outcome <- features[, 3] - features[, 5] + features[, 14] + rnorm(500)
massmod <- massGLM(outcome, features)
plot(massmod)
plot(massmod, what = "coef")
plot(massmod, what = "volcano")

## End(Not run)


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.