So, I am having issues understanding the ordination with constrained RDA. I designed four experiments which should be useful to understand what is happening with RDA but I am missing something here.
# load libraries
library("phyloseq")
library("vegan")
library("RColorBrewer")
# optional close all open plots
# graphics.off()
# load data
data("GlobalPatterns")
globp <- GlobalPatterns
# transform using Hellinger
otu_table(globp) <- otu_table(decostand(otu_table(globp),
method="hellinger"), taxa_are_rows=TRUE)
# set colours for SampleType
pltt <- brewer.pal(length(unique(sample_data(globp)$SampleType)),
"Set1")
names(pltt) <- unique(sample_data(globp)$SampleType)
# perform ordination using all the information
filtered_rda_one <- ordinate(globp, "RDA", "bray", formula = globp ~ .)
# plot
dev.new()
fig <- ordiplot(filtered_rda_one, type="none",
main=expression("formula = globp ~ ."))
points(fig, "sites", pch=21, col=pltt, bg=pltt)
# perform ordination choosing a random parameter
filtered_rda_two <- ordinate(globp, "RDA", "bray",
formula = globp ~ SampleType)
# plot
dev.new()
fig <- ordiplot(filtered_rda_two, type="none",
main=expression("formula = globp ~ SampleType"))
points(fig, "sites", pch=21, col=pltt, bg=pltt)
# now perform ordination blocking for SampleType
filtered_rda_three <- ordinate(globp, "RDA", "bray",
formula = globp ~ . + Condition(SampleType))
# plot
dev.new()
fig <- ordiplot(filtered_rda_three, type="none",
main=expression("formula = globp ~ . + Condition(SampleType)"))
points(fig, "sites", pch=21, col=pltt, bg=pltt)
# now remove the SampleType variable
sample_data(globp)$SampleType <- NULL
# perform ordination using all the information,
# except the one we just removed
filtered_rda_four <- ordinate(globp, "RDA", "bray",
formula = globp ~ .)
# plot
dev.new()
fig <- ordiplot(filtered_rda_four, type="none",
main=expression("formula = globp ~ . with SampleType <- NULL"))
points(fig, "sites", pch=21, col=pltt, bg=pltt)
Example one, two and four are providing, in my non-expert opinion, the same results (even though example two's result is weird).
To summarise:
- in example one I am using all the available variables;
- in example two I am only using SampleType;
- in example four SampleType was set as NULL;
- finally, in example three, I blocked for SampleType.
In sample three I was expecting to see some differences and that happened, since I am blocking for SampleType. What I am not getting is what is going on with the other examples: if the formulas are different how come the results, at least for examples one and four, are exactly the same? It is possible that SampleType does not explain any variance in the data since having or not having it didn't change the results. But then what happens in example two which, I think, is comparable to one and four? In this case SampleType is somehow influencing the ordination, right?