# Pairwise distances like analysis

**URL:** https://forum.qiime2.org/t/pairwise-distances-like-analysis/27625
**Category:** General Discussion
**Tags:** longitudinal
**Created:** [September 11, 2023, 7:34am UTC](https://forum.qiime2.org/t/pairwise-distances-like-analysis/27625 "2023-09-11T07:34:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [September 11, 2023, 7:34am UTC](https://forum.qiime2.org/t/pairwise-distances-like-analysis/27625/1 "2023-09-11T07:34:39Z")

</div>

Dear all,  
Currently, I am struggling with one dataset, in which the same animals were sampled 3 times: at the control diet (baseline), then all animals after diet 1 (tp1), and after diet 2 (tp2). So I don't have a control group at tp1 and tp2. Since I have an animal ID in the metadata, I decided to run something similar to pairwise distances (as I understand this plugin, at least).  
So steps I took:

1. Extracted distances of the same animals between baseline and diet 1 (Group 1).
2. Extracted distances of the same animals between baseline and diet 2 (Group 2).
3. Performed Wilcoxon test for dependent samples for each group and adjusted p-values.
4. Performed the Kruskal-Wallis test between groups 1 and 2 to check for a greater effect.

Now after I played with it enough I wonder if I missed something and if such analysis is appropriate.

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [September 11, 2023, 4:37pm UTC](https://forum.qiime2.org/t/pairwise-distances-like-analysis/27625/2 "2023-09-11T16:37:35Z")

</div>

Hi @timanix,

I think that's a reasonable approach. You _might_ want to adjust for the order, and check the magnitude of the effect between TP 1 and TP 2, just in case you dont have enough of a washout effect. I'd probably also do a permutative t-test over a KW, because I think it lets you get away with fewer assumptions.

Best,  
Justine

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [September 11, 2023, 5:48pm UTC](https://forum.qiime2.org/t/pairwise-distances-like-analysis/27625/3 "2023-09-11T17:48:16Z")

</div>

Hi @jwdebelius,  
Thank you for detailed reply 🤩! I will take a look on the permutative t-test then. For me, it is expected that tp2 will have a greater effect than tp1 just by diet composition, but I will need to consult with person who implemented the study to inquire washout info.
