Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Options for multiple comparisons in vegan::simper

Tags:

r

vegan

I am using the adonis function in the vegan package to determine differences in dissimilarities in a community (PCB congeners) between several different factors. I also have decided to use the simper function to assess which community members contributed most to the observed differences. Is there a way for to include multiple factors in the simper function? I ran the adonis model shown below successfully, but the corresponding code for the simper function doesn't work. Many thanks.

# Adonis model
pcbtest3 <- adonis(pcbcong ~ FISH_CLASS+REACH+BASIN,
                   data=pcbcov,
                   method="bray",
                   permutations=999
                   )
# pcbcong=matrix of community dissimilarities
# FISH_CLASS,REACH, BASIN are factors
# Simper
simp <- with(pcbcov, simper(pcbcong,(FISH_CLASS, BASIN, REACH)))
like image 812
outside842 Avatar asked Nov 22 '25 16:11

outside842


1 Answers

simper can be used only with one grouping variable.

A workaround would be to use interaction() to create a new grouping variable from all three factors.

Interpretation of this will be awkward (depending how many factor levels you have) and I don't know if that`s meaningful at all - so be careful.

like image 86
EDi Avatar answered Nov 25 '25 06:11

EDi