qiime2 / q2-longitudinal

QIIME 2 plugin for paired sample comparisons
BSD 3-Clause "New" or "Revised" License
9 stars 18 forks source link

Expand LME model to allow additional mixed effects #184

Open jwdebelius opened 5 months ago

jwdebelius commented 5 months ago

Current Behavior The current QIIME 2 implementation allows modeling of an interaction term with a group: $z = mx*y + b | c$ where $x$ is a continuous gradient component, $y$ is a categorical exposure variable, and $c$ is a group variable.

Proposed Behavior I would like to see 3 expansions to the function.

  1. The ability to add confounders or other adjustment to the model. For example, in a model following children, it might be useful to be able to adjust alpha diversity for birth mode, even if we're not interested in it either as a time-varying factor.
  2. The ability to opt-out of the interaction model. I do a lot of work where I'm working with something that has a grouping factor (mice in cages, combined studies, etc) where it would be advantageous to have a model that doesn't assume there's a linear gradient involved. If I want to know about the difference between treated and untreated mice in different cages at one time point, there's no linear gradient that interacts with the cage effect.
  3. The ability to add random slopes. I think this gets more complex, and is likely a seperate step, but it would be nice to be able to add additional random factors (per-individual slopes; cage and room for mice; etc). I recognize this may be a use case beyond QIIME 2's general work, but there's also multiple publications showing an individual's response to perturbation is a personalized thing.

Questions

  1. Should non-interaction or non-gradient models be presented as a seperate function (anova-group or something) or should the current functionality be updated? I can see the advantage of having a seperate, more flexibile function but have some concerns it would be mis-understood or misused.
  2. If adjustment is added to the current functionality, can it be added as a flag (confounders or something)?
  3. Is the random slopes something to wait on or is it too much?
  4. What kind of documentation or tutorials are needed to make this transition work?

Comments

I'm happy to help with documentation, coding, or review. But also not the generalized sarcasm when I describe myself as having copious free time.

lizgehret commented 4 weeks ago

Hey @jwdebelius! Let's talk about this in our ANCOM-BC2 meeting next week (as time allows). This may be something that @ebolyen would like to add into q2-stats (for any of this functionality that can't be addressed within ANCOM-BC2).