问题
My input file is organized with sample ID as the row name, and each column representing a certain Operational Taxonomic Unit, with the data being a number for Absolute Abundance of that OTU. I set up the csv file with binary dummy variables to indicate the sample as being one of 3 locations (L1, L2, L3) and one of 6 descriptive categories (D1, D2, D3, D4, D5, D6). Each sample has a 1 for both one of the three L categories and one of the 6 D categories, and zeroes for the other 7 categories they don't belong to. The dummy variables are in the first 9 columns of the data table. When I run the CCA with this formula:
L6DummyVariables.cca <- cca(L6DummyVariables[ ,10:100] ~ L1+L2+L3+D1+D2+ D3+D4+D5+D6,
data=L6DummyVariables)
and plot it, there are no vector arrows for L3 and D6. Do I need to change something in my formula? I was told by someone that they are absent because the other vectors are in relation to the missing one, but that does not seem to make sense to me. The other tutorials I have looked at seem to show all of the variables My ordination experience is very limited so my apologies if I'm missing something basic. Thank you! My CCA Plot
回答1:
L1, L2 and L3 vectors are collinear with the (Intercept) term, so one of them, L3 in this instance, is dropped. Likewise for one of your descriptive variables. It sounds like your regression or linear algebra experience is causal "limitation" here, rather than "ordination inexperience". We cannot comment on the "other" uncited tutorials. A note on terminology: "environment variables" is a term used to describe system-level variables that determine actions of R and associated packages, so using that phrase with R-programmers is likely to cause confusion if you are referring to your covariates.
It's also likely that you are wasting effort creating dummy variables. R factors are capable of encoding distinct group membership and R regression functions will automatically generate the "dummies" at the time of model.matrix construction.
来源:https://stackoverflow.com/questions/38468356/why-am-i-missing-2-environmental-variable-vectors-from-cca-plot-in-r-vegan-pack