[R-sig-eco] Appropriate adonis call for time-series data?
Lawrence David
lawrence.david at duke.edu
Mon Mar 2 21:45:10 CET 2015
Hi everyone,
I’m hoping some of you may be able to clarify how to use adonis to analyze time-series data of microbial communities.
I’ve collected community data from different individuals after the same perturbation.
I’d like to determine whether individual identity and/or time have effects on the sampled communities.
My plan for analyzing these data is to consider ‘time’ a fixed effect and ‘individual’ a random effect.
If this sounds reasonable, what might be the preferred approach for implementing this model in adonis? I am considering the following model, based on reading the vegan FAQ and these forums: adonis(dist_matrix ~ Individual + Time, strata=Individual)
I should mention that I’ve already tried this and found some curious things. First, I’ve run:
————————
adonis(formula = vegdist(data,method="bray") ~ Individual+Time, permutations=10000, strata=Individual)
Terms added sequentially (first to last)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Individual 12 4.5076 0.37563 1.2296 0.36641 2e-04 ***
Time 1 1.6845 1.68446 5.5139 0.13693 2e-04 ***
Residuals 20 6.1099 0.30549 0.49666
Total 33 12.3019 1.00000
————————
This seems surprising, as should I be able to detect a significant association with Individual, given that I’ve stratified on that variable?
I’ve also tried running adonis on just Individual alone: adonis(formula = vegdist(data, method = "bray") ~ Individual, permutations=10000, strata=Individual)
This is also a bit puzzling, as I get different results on my two workstations. According to my workstation install (R version 3.1.2 (2014-10-31); vegan 2.2-1), I get:
————————
Call:
adonis(formula = vegdist(data, method="bray") ~ Individual, permutations=10000, strata=Individual)
Blocks: strata
Permutation: free
Number of permutations: 10000
Terms added sequentially (first to last)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Individual 12 4.5076 0.37563 1.0121 0.36641 9.999e-05 ***
Residuals 21 7.7943 0.37116 0.63359
Total 33 12.3019 1.00000
————————
But, on my laptop (R version 3.0.3 (2014-03-06); vegan 2.0-9), the same call gives nearly the same results, but with different significance: Pr(>F)=1. Is strata not restricting permutations the way I want it to in the newer version of vegan?
So, to summarize, my questions are:
1) Am I using the right model design to test for an impact of time on a community sampled over time in subjects (i.e. adonis(dist_matrix ~Individual+Time,strata=Individual)
2) Is this a valid test for whether ‘Individual’ contributes to community structure?
3) Why might I be getting different results for running ‘Individual' as a single factor and a stratifying variable at the same time?
Thank you in advance for any help you can lend!
- Lawrence David
More information about the R-sig-ecology
mailing list