I have an environmental data set (LA-ICP-MS), where 46 elements are reported in ppms. I do not know whether my data is a subcompositional (compositional) or not. However, I know that an observation from classical compositional data will sum up to a constant, it is not the case for my dataset. Next thing I want to do is to apply PCA on my data, but I still do not know whether data is compositional or not.
If I treat concentrations of elements in my data as absolute values and assume that data is not compositional, I can apply log1p() function in R and then run a PCA.
PCACor = prcomp(x = df.log, retx = TRUE, center = TRUE, scale. = TRUE) biplot(PCACor)
If I assume that I have a "closed" data, I would need to apply a centered logratio transformation
clr()from the package "compositions" and then run a PCA,
PCACor = prcomp(x = df.clr, retx = TRUE, center = TRUE, scale. = TRUE) biplot(PCACor)
log1p()transformation I get a strange biplot (on the left), where all loadings are pointing to 2 directions (effect of a "closed data"?). With
clr()(on the right) I get a proper separation of the loadings on the biplot.
In addition, when I refer to literature: Filzomer et al, 2009, Principal component analysis for compositional data with outliers, there is clearly written and shown the effect of PCA on compositional data has:
And it is exactly the same pattern what I see in my data depending on the applied transformation. Images below reflect biplot of PCA on "opened" data and images above show PCA on "closed" dataset.
My questions are then next, how do I know whether my data is compositional or not if observations do not sum up to a constant? Can I assume that data is compositional just by looking at the results of PCA biplot on log-transformed data?