stepwise_regression: Stepwise Regression

View source: R/functions.R

stepwise_regressionR Documentation

Stepwise Regression

Description

This function performs multivariate forward stepwise regression evaluated by multivariate Bayesian Information Critera (BIC) by wrapping "mvIC::mvForwardStepwise()".

Usage

stepwise_regression(
  md,
  primary_variable,
  cqn_counts,
  model_variables = names(md),
  skip = NULL,
  random_effect = NULL,
  add_model = NULL
)

Arguments

md

A data frame with sample identifiers in a column and relevant experimental covariates.

primary_variable

Vector of variables that will be collapsed into a single fixed effect interaction term.

cqn_counts

A counts data frame normalized by CQN.

model_variables

Optional. Vector of variables to include in the linear (mixed) model. If not supplied, the model will include all variables in md.

skip

Defaults to NULL. If TRUE, this step will be skipped in the targets plan.

random_effect

A vector of variables to consider as random effects instead of fixed effects.

add_model

Optional. User Speciffied variables to add to the null model apriori to model generation. (Default = NULL)

Value

Table with BIC criteria for exclusion or inclusion of variables in the model, linear (mixed) model formula and vector of variables to include.


Sage-Bionetworks/sageseqr documentation built on June 13, 2024, 2:11 p.m.