model_gen function

Model Generations

Model Generations

Generate appropriate regression models based on the model type and formula

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.

Returns

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)