model_gen: Model Generations

View source: R/Help_Func.R

model_genR Documentation

Model Generations

Description

Generate appropriate regression models based on the model type and formula

Usage

model_gen(
  y,
  type = "lm",
  batch = NULL,
  covariates = NULL,
  interaction = NULL,
  random = NULL,
  smooth = NULL,
  df
)

Arguments

y

Dependent variable in the model.

type

A model function name that is used or to be used in the ComBatFamily Package (eg: "lmer", "lm", "gam").

batch

Name of batch variable (often equivalent to site or scanner).

covariates

Name of covariates supplied to model.

interaction

Expression of interaction terms supplied to model (eg: "age:diagnosis").

random

Variable name of a random effect in linear mixed effect model.

smooth

Variable name that requires a smooth function.

df

Dataset to be harmonized.

Value

A regression model object to be used for batch effect diagnostics and the post-harmonization stage.

Examples

model_gen(y = "thickness.left.caudal.anterior.cingulate", type = "lm",
batch = "manufac", covariates = c("AGE", "SEX"), df = adni)


ComBatFamQC documentation built on April 4, 2025, 12:24 a.m.