R Vegan: evaluate pairwise permanova significance between comparisons
I'm looking for a statistical test that will allow me to evaluate whether pairwise comparisons are statistically different from one another. I'm using ecological community count (abundance) data sampled across multiple sites before, during, and after an environmental perturbation insi开发者_高级运维de and outside of treatment plots. I'm specifically interested in:
- whether treatment before vs. during and/or treatment before vs. after is significant, AND the same for control.
- Importantly, whether the pairwise comparisons above are statistically different.
The first task is straightforward and easy to acquire using pairwise.adonis2()
. However, I am not sure how to approach the second task. I'd specifically like to evaluate:
- whether Treatment before vs. during is significantly different from Control before vs. during, and likewise...
- whether Treatment before vs. after is different from Control before vs. after.
I've modified dune
to fit my treatment (control, treatment) and period (before, during, after) levels simply for illustrative purposes. Is there a way to statistically evaluate these pairwise comparisons?
require(vegan)
require(pairwiseAdonis)
require(dplyr)
# Species and environmental data
dune <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/dune2.spe.txt', row.names = 1)
dune.env <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/dune2.env.txt', row.names = 1)
#rename
dune.env$Use <- recode_factor(dune.env$Use, "Haypastu" = "before")
dune.env$Use <- recode_factor(dune.env$Use, "Hayfield" = "during")
dune.env$Use <- recode_factor(dune.env$Use, "Pasture" = "after")
dune.env$Management <- recode_factor(dune.env$Management, "HF" = "SF")
dune.env$Management <- recode_factor(dune.env$Management, "NM" = "BF")
dune.env$Management <- recode_factor(dune.env$Management, "SF" = "Control")
dune.env$Management <- recode_factor(dune.env$Management, "BF" = "Treatment")
#define pairwise comparisons
dune.env1 <- dune.env %>% mutate(contrast = paste(Management, Use))
#create distmat
dune_distmat <- vegdist(dune, method="bray")
#pairwise permanova
pair_perm <- pairwise.adonis2(dune_distmat ~ contrast,
data = dune.env1, permutations = 999)
精彩评论