[R-sig-eco] Running contrasts in adonis in R

Gurski, Lauren lgurski at islander.tamucc.edu
Tue Jul 26 21:05:36 CEST 2016


Hi,


I am trying to run contrasts on my data using adonis in R. My data was collected across three islands (Big Island, Kauai, and Oahu) and on each island was collected from two microhabitats (Crevice, and Surface). I have reference and alternative alleles for each of these island:microhabitat combos. An example dataset is below:


Island,Microhabitat,REF,ALT

BI,crevice,1,0

BI,crevice,1,0

BI,crevice,1,0

BI,crevice,0,1

BI,surface,0,1

BI,surface,0,1

BI,surface,0,1

BI,surface,1,0

KA,crevice,1,0

KA,crevice,1,0

KA,crevice,1,0

KA,crevice,1,0

KA,crevice,1,0

KA,surface,0,1

KA,surface,0,1

KA,surface,1,0

KA,surface,1,0

KA,surface,1,0

KA,surface,1,0

OA,crevice,1,0

OA,crevice,1,0

OA,crevice,1,0

OA,crevice,1,0

OA,surface,1,0

OA,surface,1,0

OA,surface,1,0

OA,surface,1,0

OA,surface,1,0


I ran a two way permanova using adonis on my data with the following code:


> alleleData<-myData[,c("REF","ALT")]

> alleleData.env<-myData[,c("Pool", "Island","Microhabitat")]

> int<-adonis(alleleData ~ Island + Microhabitat + Island*Microhabitat, data=alleleData.env, permutations=10000, method="canberra", strata=NULL)


I now want to run different contrasts on my data but am having a hard time figuring out how to do it in adonis. I was wondering if there is a way to create my own contrasts to test specific questions using the contr.ordered or contr.unordered arguments? Some of the specific questions I'd like to test would be if there is a linear relationship across the islands (BI > KA > OA), or if there are differences on the just the surfaces of the rocks across the islands (BI_surface > KA_surface > OA_surface).





Thanks for the help!

Lauren

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list