1

I'm performing a pairwise adonis on my data set. I use a function that I found on research gate written by Pedro Martinez Arbizu https://www.researchgate.net/post/How_can_I_do_PerMANOVA_pairwise_contrasts_in_R. It works on some parts of my data, but on some it does not. I get a series of:

'nperm' >= set of all permutations: complete enumeration.
Set of permutations < 'minperm'. Generating entire set.

And all the pairwise p values are perfect values of 1/3 or 2/3. I have a data set for 5 marine species, over 2 time periods and eight different reasons for their capture, looking like this:

data <- data.frame(Group = c("Benthic rays","Benthic rays","Bentho Pelagic rays","Bentho Pelagic rays","Guitarfish","Guitarfish","Hammerheads","Hammerheads","Sharks","Sharks"),YearGroup =c(1,2,1,2,1,2,1,2,1,1),1 =c(65,63,73,66,32,60,23,47,25,47),2 =c(25,10,2,1,21,16,14,11,16,11),3 =c(19,9,16,8,17,10,8,3,8,2),4 =c(0,0,0,0,123,37,97,31,116,37),5 =c(0,0,3,3,0,0,0,0,0,0), 6 =c(11,41,14,42,17,38,6,26,10,29),7 =c(0,3,1,0,0,0,0,0,0,0),8 =c(52,9,44,7,14,2,6,1,7,0))

The pairwise adonis is computed the following way

pairwise.adonis(data[,3:10],data$Group)
pairwise.adonis(data[,3:10],data$YearGroup)

Somehow when I calculate the pairwise comparison between the year groups it works fine and I get a p value of 0.061. But as I mentioned when I use it to calculate the pairwise comparison between the species I only get 1/3 or 2/3. I currently read in the species as characters, because when I use them as factors I get the following error message:

 Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 
  contrasts can be applied only to factors with 2 or more levels 

Even though it is clearly a factor with 5 different levels. I'm out of ideas of what could be causing this glitch, especially as it works fine on other data sets.

Thije Zuidewind
  • 87
  • 1
  • 1
  • 7

0 Answers0