I'm struggling with understanding how or if I can use permanova (within vegan::adonis2()) to analyze a data set that has 3 levels of a "treatment", but different numbers of levels of a nested factor within each treatment. I've tried reviewing the permute vignette and Baaker's online book but I can't quite tell if I have an issue or not.
The response is presence/absence of parasite species in an aquatic critter, and we're interested in understanding if the severity of an invasive species influences the parasite community. There are 3 levels of a treatment or invaded-ness "status" (hi, med, low). A varying number of lakes falling within each category were found (2,6,4) and within each, 27 specimens were collected from each lake.
Lakes are nested within "treatment", but when I try to use the following as a constraint on the permutations I get an error about needing a balanced design.
CTRL<-how(within=Within(type='free'),
plots=Plots(strata=my.covs$lake,type='free'))
Is this just an issue with how I am defining strata? Is there some clever way of recoding the data such that gets around this or is a permanova not feasible with this design? Is it something I can manually permute? My, probably incorrect, understanding is that to test the effect of "treatment" (i.e., MS Treatment/ MS lake(treatment)) my exchangeable unit is the lake, and I thought just randomly reassigning lakes (and their 27 observations) to "treatments" was what I wanted to do, but it sounds like that's not true or not what I was specifying with the above code? If not, what is the correct way to handle this structure?
Assuming that there actually are 27 (or some multiple thereof) rows of data per lake
, I don't see why there is imbalance? Is lake
a factor?
Your how
is wrong by the way. If the treatment varies at the level of lake
and therefore is constant within the levels of lake
, you shouldn't be permuting the samples within the lake strata. What you'd want is:
ctrl <- how(
within = Within(type = "none"),
plots = Plots(strata = lake, type = "free")
)