# correlation

**URL:** <https://forum.mothur.org/t/correlation/2974>\
**Category:** Commands in mothur\
**Created:** [August 26, 2016, 11:53am UTC](https://forum.mothur.org/t/correlation/2974 "2016-08-26T11:53:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sje062](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sje062](https://forum.mothur.org/u/sje062)\
**Post date:** [August 26, 2016, 11:53am UTC](https://forum.mothur.org/t/correlation/2974/1 "2016-08-26T11:53:30Z")

</div>

Hi!  
command to tell if factor A or B determine  
the distribution of bacteria in samples.  
I am using Heatmap, PCoA, ANOSIM, Unifrac and Venn.  
Is there a number or plot I can get to show  
which factors correlate the best and drive distribution?  
Sigmund

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [August 30, 2016, 12:18pm UTC](https://forum.mothur.org/t/correlation/2974/2 "2016-08-30T12:18:45Z")

</div>

Try [corr.axes](http://mothur.org/wiki/Corr.axes).

Pat

---

<div class="post-metadata">

**Author:** ![sje062](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sje062](https://forum.mothur.org/u/sje062)\
**Post date:** [August 31, 2016, 5:40pm UTC](https://forum.mothur.org/t/correlation/2974/3 "2016-08-31T17:40:32Z")

</div>

Thanks, but my corr.axes using a metadata file:  
group habitats  
a 1  
b 2  
c 3  
etc  
(1, 2, 3 referring to ArabeanSea, Baltimore, Belize, etc  
as I understood I can’t use text in this column)  
just outputs one line and not a line for each a, b, c that  
I can use to find which habitat has the maximum ‘length’.  
Something wrong with the metadata file?  
Sigmund

---

<div class="post-metadata">

**Author:** ![sje062](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sje062](https://forum.mothur.org/u/sje062)\
**Post date:** [September 5, 2016, 6:36pm UTC](https://forum.mothur.org/t/correlation/2974/4 "2016-09-05T18:36:40Z")

</div>

Hi - I am happy for any suggestion on how  
to make vectors with metadata using corr.axes.  
Sigmund

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [September 6, 2016, 1:20pm UTC](https://forum.mothur.org/t/correlation/2974/5 "2016-09-06T13:20:19Z")

</div>

If you have categorical variables then you probably want to do ANOVA/AMOVA to see whether there are community level differences between those factors. I’m not aware of how you’d calculate a correlation with a categorical variable.

Pat
