qiime2 / q2-longitudinal

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

Test to check within-group similarity #185

Open jwdebelius opened 5 months ago

jwdebelius commented 5 months ago

Addition Description It can be helpful in cases of nested/grouped analysis to clearly demonstrate that samples within the group (individual, cage, dyad, site) are more similar to each other than they are to samples outside the group.

Proposed Behavior Using a beta diversity matrix, generate a set of paired (simple) or nested (more complex) box plots that describe the relationship between within group and outside group reference sample (See figures S2 and S4 of Debelius et al, 2023 for examples. the within vs between distances could be tested with a permutative t-test or ANOVA.

The simplest case of this is to simply look within a grouping variable vs between a grouping variable. An additional parameter could be added to select variables for "matching" if there's a concern a metadata variable might be too large, for example, age in years among young children, or country or origin.

Comments I have this code like half written 8 places and am happy to work with someone to write the underlying function, but vega plots terrify me.

lizgehret commented 4 days ago

cc @ebolyen, a good stats addition!