Guides
Guides

Longitudinal and Complex Association Testing with Formulas

Formula Configuration in MaAsLin3

What is the formula?

The formula in MaAsLin 3 is used to construct contrasts between metadata variables and microbiome features for multivariate association analysis. Written in LME4 format, it allows for the inclusion of random effects, interactions, and functions of metadata variables for mixed effect modeling.


Formula Examples

Below are examples of formula configurations for different scenarios:

ScenarioFormula Example
Fixed Effect~salmonella_enterica+days_of_life
Fixed and Random Effect~salmonella_enterica + days_of_life +(1|subject_id)
Fixed effect and interaction term~salmonella_enterica + days_of_life + salmonella_enterica:days_of_life
Fixed effect, random effects, and interaction term~salmonella_enterica + days_of_life + salmonella_enterica:days_of_life + (1|subject_id)
Group effect~group(salmonella_enterica)
Fixed effect and group effect~group(salmonella_enterica) + days_of_life
Fixed effect, random effects and group effect~group(salmonella_enterica) + days_of_life + (1|subject_id)
Ordered effect~ordered(salmonella_enterica)
Fixed effect and ordered effect~ordered(salmonella_enterica) + days_of_life
Fixed effect, random effects and ordered effect~ordered(salmonella_enterica) + days_of_life + (1|subject_id)
Strata effect~strata(salmonella_enterica)

Metadata Leveraging Instructions

To fully leverage the power of metadata in your analysis, consider the following:

  • Random Effects: Encapsulate variability across subjects or experimental units by using (1|grouping_variable) to include a random intercept for each group.
  • Interactions: Explore interactions between variables by using : to include interaction terms in your model.
  • Functions of Metadata: Include transformations or functions of metadata variables directly in the formula. If standardize=TRUE, these functions will be applied post-standardization.
  • Special Variable Types: Utilize group(grouping_variable), ordered(ordered_variable), and strata(strata_variable) to specify different types of variables.

For detailed examples and further guidance, refer to the MaAsLin 3 documentation.